Interesting backout/merge interaction

Bill Barry after.fallout at gmail.com
Tue Dec 14 18:45:15 CST 2010


I have had stuff like this happen to me as well. The most basic test 
case I have come up with is
 > hg init
 > echo a > a.txt
 > echo b > b.txt
 > hg add
adding a.txt
adding b.txt
 > hg ci -m "initial rev"
 > echo a >> a.txt
 > hg ci -m "modified a.txt"
 > hg up --rev 0
 > echo b >> b.txt
 > hg ci -m "modified b.txt"
created new head
 > hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
 > hg ci -m "merge"
 > cat .\a.txt
a
a
 > cat .\b.txt
b
b

Usually I think this is in fact what we want.


Matt Mackall wrote:
> I was surprised to discover the recent os.path.relpath bug had
> reappeared in the default branch. So I dug into it. Here's the relevant
> parts of the graph.
>
> x = revisions containing the bug
>
> x    13136  <- ancestor is 13128, o->o,x = x (mpm on Tuesday)
> |\
> | |
> x |  13129 <- ancestor is 13125, o->o,x = x (muggs on Monday)
> |\|
> | o  13128 stable
> | |
> x |  13127  <- ancestor is 13119, o->x,o = x (mg on Monday)
> |\|
> x |    13126  <- ancestor is 13104, o->o,x = x (mg on Monday)
> |\ \
> | | o    13125 stable  <- ancestor is 13105, x->o,x = o (mg on Monday)
> | | |\
> | x---+  13122  <- ancestor is 13103, o->o,x = x (tonfa on Friday)
> | | | |
> o---+ |  13120  <- (mpm on Friday)
> | | | |
> | | o |  13119 stable
> | | | |
> | | o |  13117 stable   <- backout happens here (mpm on Friday)
> | | |/
> |/ /
> | x  13105 stable   <- introduced bug (Mads, Friday)
> | |
> o |  13104
> |\|
> | o  13103 stable
>
> The most interesting merge here is 13126. Here we have one side that
> 'knows' about the backout (13120) and another side (13122) that hasn't
> seen it. But because we chose 13104 as the ancestor (which had never
> seen the bug!), we decide that introducing the bug is a good thing. Note
> that 13104 and 13105 are equally far from root, so our ancestor choice
> algorithm can't decide between them.
>
>   



More information about the Mercurial-devel mailing list