Show More
@@ -0,0 +1,66 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | # initial | |||
|
4 | hg init test-a | |||
|
5 | cd test-a | |||
|
6 | cat >test.txt <<"EOF" | |||
|
7 | 1 | |||
|
8 | 2 | |||
|
9 | 3 | |||
|
10 | EOF | |||
|
11 | hg add test.txt | |||
|
12 | hg commit -m "Initial" -d "0 0" | |||
|
13 | ||||
|
14 | # clone | |||
|
15 | cd .. | |||
|
16 | hg clone test-a test-b | |||
|
17 | ||||
|
18 | # change test-a | |||
|
19 | cd test-a | |||
|
20 | cat >test.txt <<"EOF" | |||
|
21 | one | |||
|
22 | two | |||
|
23 | three | |||
|
24 | EOF | |||
|
25 | hg commit -m "Numbers as words" -d "0 0" | |||
|
26 | ||||
|
27 | # change test-b | |||
|
28 | cd ../test-b | |||
|
29 | cat >test.txt <<"EOF" | |||
|
30 | 1 | |||
|
31 | 2.5 | |||
|
32 | 3 | |||
|
33 | EOF | |||
|
34 | hg commit -m "2 -> 2.5" -d "0 0" | |||
|
35 | ||||
|
36 | # now pull and merge from test-a | |||
|
37 | hg pull | |||
|
38 | HGMERGE=merge hg update -m | |||
|
39 | # resolve conflict | |||
|
40 | cat >test.txt <<"EOF" | |||
|
41 | one | |||
|
42 | two-point-five | |||
|
43 | three | |||
|
44 | EOF | |||
|
45 | rm -f *.orig | |||
|
46 | hg commit -m "Merge 1" -d "0 0" | |||
|
47 | ||||
|
48 | # change test-a again | |||
|
49 | cd ../test-a | |||
|
50 | cat >test.txt <<"EOF" | |||
|
51 | one | |||
|
52 | two-point-one | |||
|
53 | three | |||
|
54 | EOF | |||
|
55 | hg commit -m "two -> two-point-one" | |||
|
56 | ||||
|
57 | # pull and merge from test-a again | |||
|
58 | cd ../test-b | |||
|
59 | hg pull | |||
|
60 | HGMERGE=merge hg update --debug -m | |||
|
61 | ||||
|
62 | cat test.txt | |||
|
63 | ||||
|
64 | hg debugindex .hg/data/test.txt.i | |||
|
65 | ||||
|
66 | hg log |
@@ -0,0 +1,69 b'' | |||||
|
1 | pulling from /tmp/hgtests.12359.29374.16319.16463/test-merge7/test-a | |||
|
2 | searching for changes | |||
|
3 | adding changesets | |||
|
4 | adding manifests | |||
|
5 | adding file changes | |||
|
6 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
7 | (run 'hg update' to get a working copy) | |||
|
8 | merge: warning: conflicts during merge | |||
|
9 | merging test.txt | |||
|
10 | merging test.txt failed! | |||
|
11 | pulling from /tmp/hgtests.12359.29374.16319.16463/test-merge7/test-a | |||
|
12 | searching for changes | |||
|
13 | adding changesets | |||
|
14 | adding manifests | |||
|
15 | adding file changes | |||
|
16 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
17 | (run 'hg update' to get a working copy) | |||
|
18 | merge: warning: conflicts during merge | |||
|
19 | resolving manifests | |||
|
20 | force None allow 1 moddirstate True linear False | |||
|
21 | ancestor 055d847dd401 local 2eded9ab0a5c remote 84cf5750dd20 | |||
|
22 | test.txt versions differ, resolve | |||
|
23 | merging test.txt | |||
|
24 | resolving test.txt | |||
|
25 | file test.txt: my fc3148072371 other d40249267ae3 ancestor 8fe46a3eb557 | |||
|
26 | merging test.txt failed! | |||
|
27 | one | |||
|
28 | <<<<<<< /tmp/hgtests.12359.29374.16319.16463/test-merge7/test-b/test.txt | |||
|
29 | two-point-five | |||
|
30 | ======= | |||
|
31 | two-point-one | |||
|
32 | >>>>>>> /tmp/test.txt~other.bN33Pl | |||
|
33 | three | |||
|
34 | rev offset length base linkrev nodeid p1 p2 | |||
|
35 | 0 0 7 0 0 01365c4cca56 000000000000 000000000000 | |||
|
36 | 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000 | |||
|
37 | 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000 | |||
|
38 | 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557 | |||
|
39 | 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000 | |||
|
40 | changeset: 4:50aec39675ea | |||
|
41 | tag: tip | |||
|
42 | parent: 2:96b70246a118 | |||
|
43 | user: test | |||
|
44 | date: Mon Sep 26 23:50:15 2005 +0000 | |||
|
45 | summary: two -> two-point-one | |||
|
46 | ||||
|
47 | changeset: 3:50c3a7e29886 | |||
|
48 | parent: 1:d1e159716d41 | |||
|
49 | parent: 2:96b70246a118 | |||
|
50 | user: test | |||
|
51 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
52 | summary: Merge 1 | |||
|
53 | ||||
|
54 | changeset: 2:96b70246a118 | |||
|
55 | parent: 0:b1832b9d912a | |||
|
56 | user: test | |||
|
57 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
58 | summary: Numbers as words | |||
|
59 | ||||
|
60 | changeset: 1:d1e159716d41 | |||
|
61 | user: test | |||
|
62 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
63 | summary: 2 -> 2.5 | |||
|
64 | ||||
|
65 | changeset: 0:b1832b9d912a | |||
|
66 | user: test | |||
|
67 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
68 | summary: Initial | |||
|
69 |
@@ -439,24 +439,45 b' class revlog:' | |||||
439 | if n not in seen: |
|
439 | if n not in seen: | |
440 | seen[n] = 1 |
|
440 | seen[n] = 1 | |
441 | r = self.rev(n) |
|
441 | r = self.rev(n) | |
442 |
yield (-d, |
|
442 | yield (-d, n) | |
443 | for p in self.parents(n): |
|
443 | for p in self.parents(n): | |
444 | heapq.heappush(h, (-dist[p], p)) |
|
444 | heapq.heappush(h, (-dist[p], p)) | |
445 |
|
445 | |||
446 | x = ancestors(a) |
|
446 | def generations(node): | |
447 | y = ancestors(b) |
|
447 | sg, s = None, {} | |
448 | lx = x.next() |
|
448 | for g,n in ancestors(node): | |
449 | ly = y.next() |
|
449 | if g != sg: | |
|
450 | if sg: | |||
|
451 | yield sg, s | |||
|
452 | sg, s = g, {n:1} | |||
|
453 | else: | |||
|
454 | s[n] = 1 | |||
|
455 | yield sg, s | |||
|
456 | ||||
|
457 | x = generations(a) | |||
|
458 | y = generations(b) | |||
|
459 | gx = x.next() | |||
|
460 | gy = y.next() | |||
450 |
|
461 | |||
451 | # increment each ancestor list until it is closer to root than |
|
462 | # increment each ancestor list until it is closer to root than | |
452 | # the other, or they match |
|
463 | # the other, or they match | |
453 | while 1: |
|
464 | while 1: | |
454 | if lx == ly: |
|
465 | #print "ancestor gen %s %s" % (gx[0], gy[0]) | |
455 | return lx[2] |
|
466 | if gx[0] == gy[0]: | |
456 | elif lx < ly: |
|
467 | # find the intersection | |
457 | ly = y.next() |
|
468 | i = [ n for n in gx[1] if n in gy[1] ] | |
458 |
|
|
469 | if i: | |
459 |
|
|
470 | return i[0] | |
|
471 | else: | |||
|
472 | #print "next" | |||
|
473 | gy = y.next() | |||
|
474 | gx = x.next() | |||
|
475 | elif gx[0] < gy[0]: | |||
|
476 | #print "next y" | |||
|
477 | gy = y.next() | |||
|
478 | else: | |||
|
479 | #print "next x" | |||
|
480 | gx = x.next() | |||
460 |
|
481 | |||
461 | def group(self, linkmap): |
|
482 | def group(self, linkmap): | |
462 | """calculate a delta group |
|
483 | """calculate a delta group |
@@ -15,7 +15,7 b' remote created b' | |||||
15 | getting b |
|
15 | getting b | |
16 | merging a |
|
16 | merging a | |
17 | resolving a |
|
17 | resolving a | |
18 | file a: other d730145abbf9 ancestor b789fdd96dc2 |
|
18 | file a: my b789fdd96dc2 other d730145abbf9 ancestor b789fdd96dc2 | |
19 | resolving manifests |
|
19 | resolving manifests | |
20 | force None allow 1 moddirstate True linear True |
|
20 | force None allow 1 moddirstate True linear True | |
21 | ancestor 1165e8bd193e local 1165e8bd193e remote 1165e8bd193e |
|
21 | ancestor 1165e8bd193e local 1165e8bd193e remote 1165e8bd193e |
General Comments 0
You need to be logged in to leave comments.
Login now