views:

58

answers:

2

I am working in a model-driven environment, where Java code is generated from a MagicDraw model by AndroMDA. The models are developed iteratively, hence we would have to merge them if we create branches. But as I was told the models cannot be merged, because every time it is saved every id of every element will be replaced.

But I want to use branches, so that every task is self-contained and has an explicit starting point and endpoint.

How would you handle that? This is probably not a technical but an organizational question. How could the model be excluded from the branches without breaking them? Or is there any workaround for MagicDraw models?

(Offtopic: Generated files are not checked in.)

+4  A: 

I haven't used AndroMDA so I'm not sure if this is applicable in your situation.

However in general, if anything in your project is being automatically generated, then I would not put the generated output under version control, but rather make the generation part of the build process.

Ben James
The generated files are not checked in.
Christian Strempfer
+1  A: 

Some formats cannot be automatically merged using standard source control tools. Normal tools rely on the assumption that a line can be inserted, changed or removed without affecting every other line in the file. Some formats don't follow that assumption.

Sometimes these irritating formats have their own merge tools, which can be used after the source control tool has failed. I can't find a way to prevent subversion from attempting an auto-merge of a file (feature request?), but if subversion fails, it will dump 2 files in the working copy representing the 2 versions.

At that point, you can try here: http://www.magicdraw.com/main.php?ts=navig&cmd_show=1&menu=merge

Jim T
I could mark the model as a binary file to prevent auto-merge or will that cause problems?
Christian Strempfer
Yes, that is the general idea. Just mark it as binary if you don't want it merged, it will just use the new version to overwrite instead of merge, if you branch/change it.
Jiri Klouda