Mercurial > hg
annotate tests/test-merge7 @ 2320:dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
old code read every head of .hgtags. delete and recreate of .hgtags gave
new head, but if error in deleted rev, .hgtags had error messages every
time it was parsed. this was very hard to fix, because deleted revs hard
to get back and update, needed merges too.
new code reads .hgtags on every head. advantage is if parse error
happens with new code, is possible to fix them by editing .hgtags on a
head and committing.
NOTE: new code uses binary search of manifest of each head to be fast,
but still much slower than old code. best thing would be to have delete
record stored in filelog so we never touch manifest. could find live
heads directly from filelog. this is more work than i want now.
new tests check for parse of tags on different heads, and inaccessible
heads created by delete and recreate of .hgtags.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Thu, 18 May 2006 23:31:12 -0700 |
parents | e506c14382fd |
children | c0b449154a90 |
rev | line source |
---|---|
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
1 #!/bin/sh |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
2 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 # initial |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 hg init test-a |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 cd test-a |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 cat >test.txt <<"EOF" |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
7 1 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
8 2 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 3 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
10 EOF |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
11 hg add test.txt |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1352
diff
changeset
|
12 hg commit -m "Initial" -d "1000000 0" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
13 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 # clone |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 cd .. |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
16 hg clone test-a test-b |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
17 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
18 # change test-a |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
19 cd test-a |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
20 cat >test.txt <<"EOF" |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
21 one |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
22 two |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
23 three |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
24 EOF |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1352
diff
changeset
|
25 hg commit -m "Numbers as words" -d "1000000 0" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
26 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
27 # change test-b |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
28 cd ../test-b |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
29 cat >test.txt <<"EOF" |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
30 1 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
31 2.5 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
32 3 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
33 EOF |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1352
diff
changeset
|
34 hg commit -m "2 -> 2.5" -d "1000000 0" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
35 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
36 # now pull and merge from test-a |
1352
bf6c91cb816f
Make test-merge7 repeatable
Matt Mackall <mpm@selenic.com>
parents:
1351
diff
changeset
|
37 hg pull ../test-a |
2283
e506c14382fd
deprecate 'update -m'. use 'merge' instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
38 HGMERGE=merge hg merge |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
39 # resolve conflict |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
40 cat >test.txt <<"EOF" |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
41 one |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
42 two-point-five |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
43 three |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
44 EOF |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
45 rm -f *.orig |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1352
diff
changeset
|
46 hg commit -m "Merge 1" -d "1000000 0" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
47 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
48 # change test-a again |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
49 cd ../test-a |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
50 cat >test.txt <<"EOF" |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
51 one |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
52 two-point-one |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
53 three |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
54 EOF |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1352
diff
changeset
|
55 hg commit -m "two -> two-point-one" -d "1000000 0" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
56 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
57 # pull and merge from test-a again |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
58 cd ../test-b |
1352
bf6c91cb816f
Make test-merge7 repeatable
Matt Mackall <mpm@selenic.com>
parents:
1351
diff
changeset
|
59 hg pull ../test-a |
2283
e506c14382fd
deprecate 'update -m'. use 'merge' instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
60 HGMERGE=merge hg merge --debug |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
61 |
1352
bf6c91cb816f
Make test-merge7 repeatable
Matt Mackall <mpm@selenic.com>
parents:
1351
diff
changeset
|
62 cat test.txt | sed "s% .*%%" |
1351
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
63 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
64 hg debugindex .hg/data/test.txt.i |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
65 |
0e2be889ccd7
Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
66 hg log |