[PATCH 1 of 2 stable] graft: test coverage of grafts and how merges can break duplicate detection
Mads Kiilerich
mads at kiilerich.com
Mon May 8 22:45:01 UTC 2017
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1494281490 -7200
# Tue May 09 00:11:30 2017 +0200
# Branch stable
# Node ID 6710017995b4e8b361d6ad5b897ff7d0cc658285
# Parent 247bb7a2c492d8a946cc7ed61a627d53566b7c16
graft: test coverage of grafts and how merges can break duplicate detection
This demonstrates unfortunate behaviour: extending the graft range cause the
graft to behave differently. When the graft range includes a merge, we fail to
detect duplicates that are ancestors of the merge.
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -1309,4 +1309,49 @@ Graft a change into a new file previousl
$ hg status --change .
M b/x
+Prepare for test of skipped changesets and how merges can influence it:
+
+ $ hg merge -q -r 1 --tool :local
+ $ hg ci -m m
+ $ echo xx >> b/x
+ $ hg ci -m xx
+
+ $ hg log -G -T '{rev} {desc|firstline}'
+ @ 7 xx
+ |
+ o 6 m
+ |\
+ | o 5 y
+ | |
+ +---o 4 y
+ | |
+ | o 3 x
+ | |
+ | o 2 b
+ | |
+ o | 1 x
+ |/
+ o 0 a
+
+Grafting of plain changes correctly detects that 3 and 5 should be skipped:
+
+ $ hg up -qCr 4
+ $ hg graft --tool :local -r 2::5
+ skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
+ skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
+ grafting 2:42127f193bcd "b"
+
+Extending the graft range to include a merge will unfortunately make us miss
+that 3 and 5 should be skipped:
+
+ $ hg up -qCr 4
+ $ hg graft --tool :local -r 2::7
+ skipping ungraftable merge revision 6
+ skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
+ grafting 2:42127f193bcd "b"
+ grafting 3:ca093ca2f1d9 "x"
+ note: graft of 3:ca093ca2f1d9 created no changes to commit
+ grafting 7:d3c3f2b38ecc "xx"
+ note: graft of 7:d3c3f2b38ecc created no changes to commit
+
$ cd ..
More information about the Mercurial-devel
mailing list