[issue2685] merge to default of branch rooted in tip of default results in no merge

tomba bugs at mercurial.selenic.com
Mon Mar 7 23:33:58 UTC 2011


New submission from tomba <1ipsfgq02 at sneakemail.com>:

For development work that is more than one changeset, we create a
short-lived named branch, check in to that branch, and then merge it to the
default branch.
This way, all the detailed changes are on side branches, and default branch
contains changes in "batches", as they become available to everyone else.
This way, everyone can see details of development, which is useful when
tracking down a change that caused an issue, for example.
On the other hand, it is easy to ignore the detailed changes and look only
at changes to default branch, by following the first parent of changesets.

This worked well until version 1.7.5, but broke with version 1.8.
Example reproduction script:

----------------------------------------
#!/bin/sh -e

HG_COMMIT="hg commit -u repro -d 2011-03-07"

hg init

touch file1
hg add file1
$HG_COMMIT -m file1

touch file2
hg add file2
$HG_COMMIT -m file2

hg branch bugfix

echo "fix-part-1" >> file1
$HG_COMMIT -m 'fix part 1'

echo "fix-part-2" >> file2
$HG_COMMIT -m 'fix part 2'

hg update -r default
hg merge -r tip
$HG_COMMIT -m 'bug fix consisting of two changesets'

hg glog
----------------------------------------

Result with Mercurial 1.7.5:

@    changeset:   4:9bc128b7192d
|\   tag:         tip
| |  parent:      1:72e1a905853a
| |  parent:      3:45dc12cbabb7
| |  user:        repro
| |  date:        Mon Mar 07 00:00:00 2011 -0800
| |  summary:     bug fix consisting of two changesets
| |
| o  changeset:   3:45dc12cbabb7
| |  branch:      bugfix
| |  user:        repro
| |  date:        Mon Mar 07 00:00:00 2011 -0800
| |  summary:     fix part 2
| |
| o  changeset:   2:b9b37abd84fa
|/   branch:      bugfix
|    user:        repro
|    date:        Mon Mar 07 00:00:00 2011 -0800
|    summary:     fix part 1
|
o  changeset:   1:72e1a905853a
|  user:        repro
|  date:        Mon Mar 07 00:00:00 2011 -0800
|  summary:     file2
|
o  changeset:   0:eec999ee652c
   user:        repro
   date:        Mon Mar 07 00:00:00 2011 -0800
   summary:     file1

Result with Mercurial 1.8:

@  changeset:   4:d014fdcff49b
|  tag:         tip
|  user:        repro
|  date:        Mon Mar 07 00:00:00 2011 -0800
|  summary:     bug fix consisting of two changesets
|
o  changeset:   3:45dc12cbabb7
|  branch:      bugfix
|  user:        repro
|  date:        Mon Mar 07 00:00:00 2011 -0800
|  summary:     fix part 2
|
o  changeset:   2:b9b37abd84fa
|  branch:      bugfix
|  user:        repro
|  date:        Mon Mar 07 00:00:00 2011 -0800
|  summary:     fix part 1
|
o  changeset:   1:72e1a905853a
|  user:        repro
|  date:        Mon Mar 07 00:00:00 2011 -0800
|  summary:     file2
|
o  changeset:   0:eec999ee652c
   user:        repro
   date:        Mon Mar 07 00:00:00 2011 -0800
   summary:     file1

Note, that command "hg merge" quietly ignored the merge request and simply
created a single-parent changeset that changed the branch name back to default.
There seems to be no way to create a merge changeset of revisions 1 and 3.
The "messy details" of bug development end up on the main development line
when following the parent revisions.

----------
messages: 15543
nosy: tomba
priority: urgent
status: unread
title: merge to default of branch rooted in tip of default results in no merge

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2685>
____________________________________________________


More information about the Mercurial-devel mailing list