Interesting backout/merge interaction

Matt Mackall mpm at selenic.com
Tue Dec 14 18:22:22 CST 2010

```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.

--
Mathematics is the supreme nostalgia of our time.

```