Show More
@@ -0,0 +1,85 b'' | |||||
|
1 | #!/bin/sh -x | |||
|
2 | ||||
|
3 | cat <<'EOF' > merge | |||
|
4 | #!/bin/sh | |||
|
5 | echo merging for `basename $1` | |||
|
6 | EOF | |||
|
7 | chmod +x merge | |||
|
8 | ||||
|
9 | mkdir t | |||
|
10 | cd t | |||
|
11 | hg init | |||
|
12 | echo This is file a1 > a | |||
|
13 | hg add a | |||
|
14 | hg commit -t "commit #0" -d "0 0" -u user | |||
|
15 | echo This is file b1 > b | |||
|
16 | hg add b | |||
|
17 | hg commit -t "commit #1" -d "0 0" -u user | |||
|
18 | ||||
|
19 | hg update 0 | |||
|
20 | echo This is file c1 > c | |||
|
21 | hg add c | |||
|
22 | hg commit -t "commit #2" -d "0 0" -u user | |||
|
23 | echo This is file b1 > b | |||
|
24 | env HGMERGE=../merge hg update -m 1 | |||
|
25 | # no merges expected | |||
|
26 | cd ..; /bin/rm -rf t | |||
|
27 | ||||
|
28 | mkdir t | |||
|
29 | cd t | |||
|
30 | hg init | |||
|
31 | echo This is file a1 > a | |||
|
32 | hg add a | |||
|
33 | hg commit -t "commit #0" -d "0 0" -u user | |||
|
34 | echo This is file b1 > b | |||
|
35 | hg add b | |||
|
36 | hg commit -t "commit #1" -d "0 0" -u user | |||
|
37 | ||||
|
38 | hg update 0 | |||
|
39 | echo This is file c1 > c | |||
|
40 | hg add c | |||
|
41 | hg commit -t "commit #2" -d "0 0" -u user | |||
|
42 | echo This is file b2 > b | |||
|
43 | env HGMERGE=../merge hg update -m 1 | |||
|
44 | # merge of b expected | |||
|
45 | cd ..; /bin/rm -rf t | |||
|
46 | ||||
|
47 | mkdir t | |||
|
48 | cd t | |||
|
49 | hg init | |||
|
50 | echo This is file a1 > a | |||
|
51 | hg add a | |||
|
52 | hg commit -t "commit #0" -d "0 0" -u user | |||
|
53 | echo This is file b1 > b | |||
|
54 | hg add b | |||
|
55 | hg commit -t "commit #1" -d "0 0" -u user | |||
|
56 | echo This is file b22 > b | |||
|
57 | hg commit -t "commit #2" -d "0 0" -u user | |||
|
58 | hg update 1 | |||
|
59 | echo This is file c1 > c | |||
|
60 | hg add c | |||
|
61 | hg commit -t "commit #3" -d "0 0" -u user | |||
|
62 | echo This is file b22 > b | |||
|
63 | env HGMERGE=../merge hg update -m 2 | |||
|
64 | # no merges expected | |||
|
65 | cd ..; /bin/rm -rf t | |||
|
66 | ||||
|
67 | mkdir t | |||
|
68 | cd t | |||
|
69 | hg init | |||
|
70 | echo This is file a1 > a | |||
|
71 | hg add a | |||
|
72 | hg commit -t "commit #0" -d "0 0" -u user | |||
|
73 | echo This is file b1 > b | |||
|
74 | hg add b | |||
|
75 | hg commit -t "commit #1" -d "0 0" -u user | |||
|
76 | echo This is file b22 > b | |||
|
77 | hg commit -t "commit #2" -d "0 0" -u user | |||
|
78 | hg update 1 | |||
|
79 | echo This is file c1 > c | |||
|
80 | hg add c | |||
|
81 | hg commit -t "commit #3" -d "0 0" -u user | |||
|
82 | echo This is file b33 > b | |||
|
83 | env HGMERGE=../merge hg update -m 2 | |||
|
84 | # merge of b expected | |||
|
85 | cd ..; /bin/rm -rf t |
@@ -0,0 +1,78 b'' | |||||
|
1 | + cat | |||
|
2 | + chmod +x merge | |||
|
3 | + mkdir t | |||
|
4 | + cd t | |||
|
5 | + hg init | |||
|
6 | + echo This is file a1 | |||
|
7 | + hg add a | |||
|
8 | + hg commit -t 'commit #0' -d '0 0' -u user | |||
|
9 | + echo This is file b1 | |||
|
10 | + hg add b | |||
|
11 | + hg commit -t 'commit #1' -d '0 0' -u user | |||
|
12 | + hg update 0 | |||
|
13 | + echo This is file c1 | |||
|
14 | + hg add c | |||
|
15 | + hg commit -t 'commit #2' -d '0 0' -u user | |||
|
16 | + echo This is file b1 | |||
|
17 | + env HGMERGE=../merge hg update -m 1 | |||
|
18 | + cd .. | |||
|
19 | + /bin/rm -rf t | |||
|
20 | + mkdir t | |||
|
21 | + cd t | |||
|
22 | + hg init | |||
|
23 | + echo This is file a1 | |||
|
24 | + hg add a | |||
|
25 | + hg commit -t 'commit #0' -d '0 0' -u user | |||
|
26 | + echo This is file b1 | |||
|
27 | + hg add b | |||
|
28 | + hg commit -t 'commit #1' -d '0 0' -u user | |||
|
29 | + hg update 0 | |||
|
30 | + echo This is file c1 | |||
|
31 | + hg add c | |||
|
32 | + hg commit -t 'commit #2' -d '0 0' -u user | |||
|
33 | + echo This is file b2 | |||
|
34 | + env HGMERGE=../merge hg update -m 1 | |||
|
35 | merging for b | |||
|
36 | merging b | |||
|
37 | + cd .. | |||
|
38 | + /bin/rm -rf t | |||
|
39 | + mkdir t | |||
|
40 | + cd t | |||
|
41 | + hg init | |||
|
42 | + echo This is file a1 | |||
|
43 | + hg add a | |||
|
44 | + hg commit -t 'commit #0' -d '0 0' -u user | |||
|
45 | + echo This is file b1 | |||
|
46 | + hg add b | |||
|
47 | + hg commit -t 'commit #1' -d '0 0' -u user | |||
|
48 | + echo This is file b22 | |||
|
49 | + hg commit -t 'commit #2' -d '0 0' -u user | |||
|
50 | + hg update 1 | |||
|
51 | + echo This is file c1 | |||
|
52 | + hg add c | |||
|
53 | + hg commit -t 'commit #3' -d '0 0' -u user | |||
|
54 | + echo This is file b22 | |||
|
55 | + env HGMERGE=../merge hg update -m 2 | |||
|
56 | + cd .. | |||
|
57 | + /bin/rm -rf t | |||
|
58 | + mkdir t | |||
|
59 | + cd t | |||
|
60 | + hg init | |||
|
61 | + echo This is file a1 | |||
|
62 | + hg add a | |||
|
63 | + hg commit -t 'commit #0' -d '0 0' -u user | |||
|
64 | + echo This is file b1 | |||
|
65 | + hg add b | |||
|
66 | + hg commit -t 'commit #1' -d '0 0' -u user | |||
|
67 | + echo This is file b22 | |||
|
68 | + hg commit -t 'commit #2' -d '0 0' -u user | |||
|
69 | + hg update 1 | |||
|
70 | + echo This is file c1 | |||
|
71 | + hg add c | |||
|
72 | + hg commit -t 'commit #3' -d '0 0' -u user | |||
|
73 | + echo This is file b33 | |||
|
74 | + env HGMERGE=../merge hg update -m 2 | |||
|
75 | merging for b | |||
|
76 | merging b | |||
|
77 | + cd .. | |||
|
78 | + /bin/rm -rf t |
@@ -1035,6 +1035,15 b' class localrepository:' | |||||
1035 | if f in m2: |
|
1035 | if f in m2: | |
1036 | s = 0 |
|
1036 | s = 0 | |
1037 |
|
1037 | |||
|
1038 | # is the wfile new since m1, and match m2? | |||
|
1039 | if n not in m1: | |||
|
1040 | t1 = self.wfile(f).read() | |||
|
1041 | t2 = self.file(f).revision(m2[f]) | |||
|
1042 | if cmp(t1, t2) == 0: | |||
|
1043 | mark[f] = 1 | |||
|
1044 | n = m2[f] | |||
|
1045 | del t1, t2 | |||
|
1046 | ||||
1038 | # are files different? |
|
1047 | # are files different? | |
1039 | if n != m2[f]: |
|
1048 | if n != m2[f]: | |
1040 | a = ma.get(f, nullid) |
|
1049 | a = ma.get(f, nullid) |
General Comments 0
You need to be logged in to leave comments.
Login now