managing multi-version development with mercurial

Diego Oliveira lokimad at gmail.com
Fri Dec 4 10:51:20 CST 2009


Hello Alexander,



On Fri, Dec 4, 2009 at 1:38 PM, Alexander Schatten <
ml_alexanderschatten at gmx.at> wrote:

> Sorry, now I have to add a probably dumb question to this thread. Actually
> about the "merge" suggestions. I wonder how merges could help; let me
> explain my question:
>
> Assume
>
> (1) I have V1, then code develops to V2.
>
> (2) Now, a bugfix is needed in V1 that generates V1.0 --> V1.1; this bugfix
> is *not* needed in V2, because it already changed to V2.2 and this bugfix is
> not relevant any more
>

I don't think "branching" per minor change is a good idea, I'm currently
branching by big changes(1.*, 2.*, etc) and
tagging the minor changes/bug fix releases.


>
> (3) I Update V2.2 on multiple steps to V2.5
>
> (4) Another bugfix is needed and makes:V1.1 --> V1.2; now THIS bugfix is
> also needed in V2.5
>
> Now, these two branches are significantly different. A merge from 1.2 -->
> 2.5 would, as I understand it also add the changes from 1.0 --> 1.1, and
> these I do most likely not want in Version 2.
>
>
> I believe, this is a pretty usual scenario, no?


Yes, this is pretty usual, but it's not a real problem, at last for me. When
u do a merge, the merge operation takes care of what changes each version
has made in the file based on the closer common version. Imagine the
following.

the file1.cpp common based version for V1 and V2.
100 | (...)
101 | function int abc(int value)
102 | {
103 |     if ( value > 10)
104 |         return 0;
105 |     else
106 |         return 1;
107 | }
108 | (...)

the same file at V1.1 (bug fix)
100 | (...)
101 | function int abc(int value)
102 | {
103 |     if ( value > 10 || value == 6 )
104 |         return -1;
105 |     else
106 |         return 2;
107 | }
108 | (...)

The file in V2.1, the method is gone, but is a little closer the the
original
the same file at V1.1 (bug fix)
  95 | (...)
  96 | function int new_function(int a, int b)
  97 | {
     (...)
102 |     int value = a * b;
103 |     if ( value = EXPECTEDNUM )
104 |         return 0;
105 |     else
106 |         return 1;
107 | }
108 | (...)

The merge operation will offer u a automatic merge for lines 104 to 106(a),
but ask u
a merge for line 103(b).

a) Your version didn't change the lines from the base common version, but
the other
did, so the other must be right.
b) You did a change to the line, and the other too, what is right?

You'll need to make this merge by your self. In this scheme you need to keep
the file
at V1.1 because the old function don't exist any more.

In my experience this is a very particular case, and don't happens so often.

Do I get something wrong here?
>
> thank you very much.
>
>
>
>
> Alex
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>



-- 
Att.
Diego de Oliveira
System Architect
diego at diegooliveira.com
www.diegooliveira.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20091204/9b9d0481/attachment.htm>


More information about the Mercurial mailing list