Patchwork D8078: tests/test-copies-chain-merge.t

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-a4xi7u6qj4molob5v4r3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44955/
State Superseded
Headers show

Comments

phabricator - Feb. 5, 2020, 2:37 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 5, 2020, 4:32 p.m.
This revision now requires changes to proceed.
martinvonz added a comment.
martinvonz requested changes to this revision.


  Missing (proper) commit message. I assume the title line would be something like "tests: add tests for copies across a chain of merges", but I'm not sure what the body would be.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Feb. 6, 2020, 9:31 a.m.
marmoute added a comment.


  oops, this one got out by mistake.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Feb. 6, 2020, 9:04 p.m.
martinvonz added a comment.


  In D8078#119493 <https://phab.mercurial-scm.org/D8078#119493>, @marmoute wrote:
  
  > oops, this one got out by mistake.
  
  But now it's ready for review (seems ready to me)? Thanks for adding these tests.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Feb. 6, 2020, 9:39 p.m.
marmoute added a comment.


  Yeah, not it is. I added extra comment and output to review and clarify things.
  
  FYI, coming next on this topic is fixing some inconsistency and then fixing then changeset centric behavior. (but do not hold your breath, nodemap has an higher priority)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - March 6, 2020, 8:32 a.m.
martinvonz added a comment.


  Sorry that I missed the review of this patch earlier. I hope you can still address my comments and send any resulting changes as follow-up patches in the same series as D8235 <https://phab.mercurial-scm.org/D8235>.

INLINE COMMENTS

> test-copies-chain-merge.t:1
> +=====================================================
> +Test Copy tracing for chain of copies involving merge

Why doesn't this one have a `#testcases` line like `test-copies.t` does?  It seems useful to check that how these cases work when copies are stored in changesets or sidedata too, right?

> test-copies-chain-merge.t:7
> +are involved. It cheks we do not have unwanted update of behavior and that the
> +different options to retrieve copies behave correctly.
> +

This sounds like it's talking about that `#testcases` thing, right? You planned to add it earlier and then didn't? Why not?

> test-copies-chain-merge.t:12
> +
> +use git diff to see rename
> +

doesn't seem used

> test-copies-chain-merge.t:60
> +
> +And Having another branch with renames on the other side
> +

I'm confused by this. It doesn't seem to have any renames. Just a stale description?

Sorry about comments that should have been on the patch introducing these tests but I hope you can send a separate patch in this series to address this.

> test-copies-chain-merge.t:259-293
> +Merge:
> +- one with change to an unrelated file
> +- one deleting and recreating the change
> +
> +  $ hg up 'desc("a-2")'
> +  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +  $ hg merge 'desc("e-2")'

This seems similar to https://www.mercurial-scm.org/repo/hg/file/07b79569fdf8/tests/test-copies.t#l409. Does it turn out to find different bugs in the code?

> test-copies-chain-merge.t:349-386
> +merging with unrelated change does not interfer wit the renames
> +---------------------------------------------------------------
> +
> +- rename on one side
> +- unrelated change on the other side
> +
> +  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'

Why is this here instead of around line 111? Now I have to scroll back and forth to remind myself what about what the commits here were about. It would have been easier if the tests were just after the setup for that part. That's also how we generally write tests.

(I actually ended up copying the setup and the the verification for each part into an editor just so I could review this patch.)

> test-copies-chain-merge.t:388-445
> +merging with the side having a delete
> +-------------------------------------
> +
> +case summary:
> +- one with change to an unrelated file
> +- one deleting the change
> +and recreate an unrelated file after the merge

This doesn't seem to belong in a file called `test-copies*`. What's the connection to copies that I'm missing? Don't we have coverage for this already anyway?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz, pulkit
Cc: martinvonz, mercurial-devel
phabricator - March 6, 2020, 10:08 a.m.
marmoute added inline comments.

INLINE COMMENTS

> martinvonz wrote in test-copies-chain-merge.t:1
> Why doesn't this one have a `#testcases` line like `test-copies.t` does?  It seems useful to check that how these cases work when copies are stored in changesets or sidedata too, right?

Because these case are broken with these version. I am introducing the `#testcases` variants once it is fixed. In D8244 <https://phab.mercurial-scm.org/D8244>

> martinvonz wrote in test-copies-chain-merge.t:7
> This sounds like it's talking about that `#testcases` thing, right? You planned to add it earlier and then didn't? Why not?

See previous comment.

> martinvonz wrote in test-copies-chain-merge.t:12
> doesn't seem used

It is used during debug having the line prevent confusion.

> martinvonz wrote in test-copies-chain-merge.t:60
> I'm confused by this. It doesn't seem to have any renames. Just a stale description?
> 
> Sorry about comments that should have been on the patch introducing these tests but I hope you can send a separate patch in this series to address this.

That line seems swapped with the previous one. I'll send a patch.

> martinvonz wrote in test-copies-chain-merge.t:259-293
> This seems similar to https://www.mercurial-scm.org/repo/hg/file/07b79569fdf8/tests/test-copies.t#l409. Does it turn out to find different bugs in the code?

This is pretty much the same test. In a more systemic effort.

> martinvonz wrote in test-copies-chain-merge.t:349-386
> Why is this here instead of around line 111? Now I have to scroll back and forth to remind myself what about what the commits here were about. It would have been easier if the tests were just after the setup for that part. That's also how we generally write tests.
> 
> (I actually ended up copying the setup and the the verification for each part into an editor just so I could review this patch.)

Because what you suggest cannot be achieve. Since we reuse branches for various cases, we cannot have the tests close to the definition of their branches. I tried, it was confusing and I moved to the organisation currently in core.

> martinvonz wrote in test-copies-chain-merge.t:388-445
> This doesn't seem to belong in a file called `test-copies*`. What's the connection to copies that I'm missing? Don't we have coverage for this already anyway?

Because the file we delete has copies information. And we track how it could get accessed.

I am not aware of other systemic testing of this.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz, pulkit
Cc: martinvonz, mercurial-devel
phabricator - March 6, 2020, 10:16 a.m.
marmoute added inline comments.

INLINE COMMENTS

> marmoute wrote in test-copies-chain-merge.t:259-293
> This is pretty much the same test. In a more systemic effort.

(also, with more chaining)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz, pulkit
Cc: martinvonz, mercurial-devel
phabricator - March 6, 2020, 1:26 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> marmoute wrote in test-copies-chain-merge.t:349-386
> Because what you suggest cannot be achieve. Since we reuse branches for various cases, we cannot have the tests close to the definition of their branches. I tried, it was confusing and I moved to the organisation currently in core.

How about setting up the *branches* first then, and then the merges together with the verification?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz, pulkit
Cc: martinvonz, mercurial-devel
phabricator - March 6, 2020, 2:17 p.m.
marmoute added inline comments.

INLINE COMMENTS

> martinvonz wrote in test-copies-chain-merge.t:349-386
> How about setting up the *branches* first then, and then the merges together with the verification?

I tried that too and was not very convinced. Especially now that we have all the test file setup that way I don't see a significant enough difference to be worth the time sink this will be.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8078/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8078

To: marmoute, #hg-reviewers, martinvonz, pulkit
Cc: martinvonz, mercurial-devel

Patch

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
new file mode 100644
--- /dev/null
+++ b/tests/test-copies-chain-merge.t
@@ -0,0 +1,461 @@ 
+Test Copy tracing for chain of copies involving merge.
+=======================================================
+
+Setup
+=====
+
+use git diff to see rename
+
+  $ cat << EOF >> $HGRCPATH
+  > [diff]
+  > git=yes
+  > [ui]
+  > logtemplate={rev} {desc}]\n
+  > EOF
+
+  $ hg init repo-chain
+  $ cd repo-chain
+
+Add some linear rename initialy
+
+  $ touch a b
+  $ hg ci -Am 'i-0 initial commit: a b'
+  adding a
+  adding b
+  $ hg mv a c
+  $ hg ci -Am 'i-1: a -move-> c'
+  $ hg mv c d
+  $ hg ci -Am 'i-2: c -move-> d'
+
+Have a branching with nothing on one side
+
+  $ hg mv d e
+  $ hg ci -Am 'a-1: d -move-> e'
+  $ hg mv e f
+  $ hg ci -Am 'a-2: e -move-> f'
+
+And Having another branch with renames on the other side
+
+  $ hg up 'desc("i-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo foo > b
+  $ hg ci -m 'b-1: b update'
+  created new head
+
+
+Merge the two branches we just defined (in both directions)
+- one with change to an unrelated file
+- one with renames in them
+
+  $ hg up 'desc("b-1")'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("a-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mBAm-0 simple merge - one way'
+  $ hg up 'desc("a-2")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("b-1")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mABm-0 simple merge - the other way'
+  created new head
+
+Create a branch that delete a file previous renamed
+
+  $ hg up 'desc("i-2")'
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg rm d
+  $ hg ci -m 'c-1 delete d'
+  created new head
+
+Merge:
+- one with change to an unrelated file
+- one deleting the change
+and recreate an unrelated file after the merge
+
+  $ hg up 'desc("b-1")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("c-1")'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mBCm-0 simple merge - one way'
+  $ echo bar > d
+  $ hg add d
+  $ hg ci -m 'mBCm-1 re-add d'
+  $ hg up 'desc("c-1")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 'desc("b-1")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mCBm-0 simple merge - the other way'
+  created new head
+  $ echo bar > d
+  $ hg add d
+  $ hg ci -m 'mCBm-1 re-add d'
+
+Create a branch that delete a file previous renamed and recreate it
+
+  $ hg up 'desc("i-2")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg rm d
+  $ hg ci -m 'd-1 delete d'
+  created new head
+  $ echo bar > d
+  $ hg add d
+  $ hg ci -m 'd-2 re-add d'
+
+Merge:
+- one with change to an unrelated file
+- one deleting and recreating the change
+
+Note:
+| In this case, the merge get conflicting information since on one side we have
+| a "brand new" d. and one the other one we have "d renamed from c (itself
+| renamed from c)".
+|
+| The current code arbitrarily pick one side
+
+  $ hg up 'desc("b-1")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("d-2")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mBDm-0 simple merge - one way'
+  $ hg up 'desc("d-2")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("b-1")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mDBm-0 simple merge - the other way'
+  created new head
+
+Having another branch renaming a different file to the same filename as another
+
+  $ hg up 'desc("i-2")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg mv b g
+  $ hg ci -m 'e-1 b -move-> g'
+  created new head
+  $ hg mv g f
+  $ hg ci -m 'e-2 g -move-> f'
+
+Merge:
+- one with change to an unrelated file
+- one deleting and recreating the change
+
+  $ hg up 'desc("a-2")'
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 'desc("e-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mAEm-0 simple merge - one way'
+  $ hg up 'desc("e-2")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("a-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mEAm-0 simple merge - the other way'
+  created new head
+
+Note:
+| In this case, the merge get conflicting information since each side have a
+| different way to reach 'f'.
+
+final summary
+
+  $ hg log -G
+  @    20 mEAm-0 simple merge - the other way]
+  |\
+  +---o  19 mAEm-0 simple merge - one way]
+  | |/
+  | o  18 e-2 g -move-> f]
+  | |
+  | o  17 e-1 b -move-> g]
+  | |
+  | | o    16 mDBm-0 simple merge - the other way]
+  | | |\
+  | | +---o  15 mBDm-0 simple merge - one way]
+  | | | |/
+  | | | o  14 d-2 re-add d]
+  | | | |
+  | +---o  13 d-1 delete d]
+  | | |
+  | | | o  12 mCBm-1 re-add d]
+  | | | |
+  | | | o  11 mCBm-0 simple merge - the other way]
+  | | |/|
+  | | | | o  10 mBCm-1 re-add d]
+  | | | | |
+  | | +---o  9 mBCm-0 simple merge - one way]
+  | | | |/
+  | +---o  8 c-1 delete d]
+  | | |
+  +-----o  7 mABm-0 simple merge - the other way]
+  | | |/
+  +-----o  6 mBAm-0 simple merge - one way]
+  | | |/
+  | | o  5 b-1: b update]
+  | |/
+  o |  4 a-2: e -move-> f]
+  | |
+  o |  3 a-1: d -move-> e]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+  
+
+Check results
+=============
+
+merging with unrelated change does not interfer wit the renames
+---------------------------------------------------------------
+
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mAB")'
+  A f
+    d
+  R d
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBA")'
+  A f
+    d
+  R d
+  $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAB")'
+  M b
+  $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBA")'
+  M b
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAB")'
+  M b
+  A f
+    d
+  R d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBA")'
+  M b
+  A f
+    d
+  R d
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAB")'
+  M b
+  A f
+    a
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBA")'
+  M b
+  A f
+    a
+  R a
+
+merging with the side having a delete
+-------------------------------------
+
+- comparing from the merge
+
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
+  R d
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
+  R d
+  $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
+  M b
+  $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
+  M b
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
+  M b
+  R d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
+  M b
+  R d
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
+  M b
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
+  M b
+  R a
+
+- comparing with the merge children re-adding the file
+
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
+  M d
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
+  M d
+  $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
+  M b
+  A d
+  $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
+  M b
+  A d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
+  M b
+  M d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
+  M b
+  M d
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
+  M b
+  A d
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
+  M b
+  A d
+  R a
+
+Comparing with a merge re-adding the file afterward
+---------------------------------------------------
+
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
+  M d
+  $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
+  M d
+  $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
+  M b
+  M d
+  $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
+  M b
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
+  M b
+  M d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
+  M b
+  M d
+
+The recorde copy is different depending of where we started the merge from since
+
+  $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644   d'
+  0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644   d
+  $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644   d'
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
+
+This second b004912a8510032a0350a74daa2803dadfb00e12 seems wrong. We should record the merge
+  $ hg manifest --debug --rev 'desc("d-2")' | grep '644   d'
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
+  $ hg manifest --debug --rev 'desc("b-1")' | grep '644   d'
+  01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644   d
+  $ hg debugindex d
+     rev linkrev nodeid       p1           p2
+       0       2 01c2f5eabdc4 000000000000 000000000000
+       1      10 b004912a8510 000000000000 000000000000
+       2      15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
+
+  $ hg log -Gfr 'desc("mBDm-0")' d
+  o    15 mBDm-0 simple merge - one way]
+  |\
+  o :  14 d-2 re-add d]
+  :/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+  
+
+(That output seems wrong, if we had opportunity to record the merge, we should
+probably have recorded the merge).
+
+  $ hg log -Gfr 'desc("mDBm-0")' d
+  o  14 d-2 re-add d]
+  |
+  ~
+
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
+  M b
+  A d
+    a
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
+  M b
+  A d
+  R a
+
+Comparing with a merge re-adding the file afterward
+---------------------------------------------------
+
+  $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644   f'
+  eb806e34ef6be4c264effd5933d31004ad15a793 644   f
+  $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644   f'
+  eb806e34ef6be4c264effd5933d31004ad15a793 644   f
+  $ hg manifest --debug --rev 'desc("a-2")' | grep '644   f'
+  0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644   f
+  $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
+  6da5a2eecb9c833f830b67a4972366d49a9a142c 644   f
+  $ hg debugindex f
+     rev linkrev nodeid       p1           p2
+       0       4 0dd616bc7ab1 000000000000 000000000000
+       1      18 6da5a2eecb9c 000000000000 000000000000
+       2      19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
+  $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
+  M f
+  R b
+  $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
+  M f
+  R b
+  $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
+  M f
+  R d
+  $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
+  M f
+  R d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
+  A f
+    d
+  R d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
+  A f
+    b
+  R b
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
+  A f
+    d
+  R b
+  R d
+  $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
+  A f
+    d
+  R b
+  R d
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
+  A f
+    a
+  R a
+  R b
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
+  A f
+    a
+  R a
+  R b
+
+  $ hg log -Gfr 'desc("mAEm-0")' f
+  o    19 mAEm-0 simple merge - one way]
+  |\
+  | o  18 e-2 g -move-> f]
+  | |
+  | o  17 e-1 b -move-> g]
+  | |
+  o |  4 a-2: e -move-> f]
+  | |
+  o |  3 a-1: d -move-> e]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+  
+
+  $ hg log -Gfr 'desc("mEAm-0")' f
+  @    20 mEAm-0 simple merge - the other way]
+  |\
+  | o  18 e-2 g -move-> f]
+  | |
+  | o  17 e-1 b -move-> g]
+  | |
+  o |  4 a-2: e -move-> f]
+  | |
+  o |  3 a-1: d -move-> e]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+