annotate tests/test-merge-local @ 5149:ad6b97132b81

merge: fix a copy detection bug (issue672) When merging rev1 and rev2, we want to search for copies that happened in rev1 but not in rev2 and vice-versa. We were starting the search at rev1/rev2 and then going back, stopping as soon as we reached the revno of the ancestor, but that can miss some cases (see the new test-issue672). Now we calculate the revisions that are ancestors of rev1 or rev2 (but not both) and make sure the search doesn't stop too early. Simplified test provided by mpm, based on a test case provided by Edward Lee.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 12 Aug 2007 12:15:10 -0300
parents 46280c004f22
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
1 #!/bin/sh
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
3 hg init
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
4
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
5 echo "# revision 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
6 echo "unchanged" > unchanged
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
7 echo "remove me" > remove
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
8 echo "copy me" > copy
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
9 echo "move me" > move
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
10 for i in 1 2 3 4 5 6 7 8 9; do
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
11 echo "merge ok $i" >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
12 done
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
13 echo "merge bad" > zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
14 hg ci -Am "revision 0" -d "1000000 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
15
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
16 echo "# revision 1"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
17 hg rm remove
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
18 hg mv move moved
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
19 hg cp copy copied
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
20 echo "added" > added
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
21 hg add added
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
22 echo "new first line" > zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
23 hg cat zzz1_merge_ok >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
24 echo "new last line" >> zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
25 hg ci -m "revision 1" -d "1000000 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
26
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
27 echo "# local changes to revision 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
28 hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
29 echo "new last line" >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
30 echo "another last line" >> zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
31 hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
32 hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
33
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
34 echo "# local merge with bad merge tool"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
35 HGMERGE=false hg co
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
36 hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
37 hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
38 hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
39
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
40 echo "# local merge with conflicts"
4361
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3869
diff changeset
41 hg co
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
42 hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
43 hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
44 hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
45
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
46 echo "# local merge without conflicts"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
47 hg revert zzz2_merge_bad
4361
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3869
diff changeset
48 hg co
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
49 hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
50 hg st