1 #!/bin/sh |
|
2 |
|
3 cat <<EOF > merge |
|
4 import sys, os |
|
5 |
|
6 try: |
|
7 import msvcrt |
|
8 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
9 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
10 except ImportError: |
|
11 pass |
|
12 |
|
13 print "merging for", os.path.basename(sys.argv[1]) |
|
14 EOF |
|
15 HGMERGE="python ../merge"; export HGMERGE |
|
16 |
|
17 mkdir t |
|
18 cd t |
|
19 hg init |
|
20 echo This is file a1 > a |
|
21 hg add a |
|
22 hg commit -m "commit #0" -d "1000000 0" |
|
23 echo This is file b1 > b |
|
24 hg add b |
|
25 hg commit -m "commit #1" -d "1000000 0" |
|
26 |
|
27 hg update 0 |
|
28 echo This is file c1 > c |
|
29 hg add c |
|
30 hg commit -m "commit #2" -d "1000000 0" |
|
31 echo This is file b1 > b |
|
32 echo %% no merges expected |
|
33 hg merge -P 1 |
|
34 hg merge 1 |
|
35 hg diff --nodates |
|
36 hg status |
|
37 cd ..; rm -r t |
|
38 |
|
39 mkdir t |
|
40 cd t |
|
41 hg init |
|
42 echo This is file a1 > a |
|
43 hg add a |
|
44 hg commit -m "commit #0" -d "1000000 0" |
|
45 echo This is file b1 > b |
|
46 hg add b |
|
47 hg commit -m "commit #1" -d "1000000 0" |
|
48 |
|
49 hg update 0 |
|
50 echo This is file c1 > c |
|
51 hg add c |
|
52 hg commit -m "commit #2" -d "1000000 0" |
|
53 echo This is file b2 > b |
|
54 echo %% merge should fail |
|
55 hg merge 1 |
|
56 echo %% merge of b expected |
|
57 hg merge -f 1 |
|
58 hg diff --nodates |
|
59 hg status |
|
60 cd ..; rm -r t |
|
61 echo %% |
|
62 |
|
63 mkdir t |
|
64 cd t |
|
65 hg init |
|
66 echo This is file a1 > a |
|
67 hg add a |
|
68 hg commit -m "commit #0" -d "1000000 0" |
|
69 echo This is file b1 > b |
|
70 hg add b |
|
71 hg commit -m "commit #1" -d "1000000 0" |
|
72 echo This is file b22 > b |
|
73 hg commit -m "commit #2" -d "1000000 0" |
|
74 hg update 1 |
|
75 echo This is file c1 > c |
|
76 hg add c |
|
77 hg commit -m "commit #3" -d "1000000 0" |
|
78 |
|
79 echo 'Contents of b should be "this is file b1"' |
|
80 cat b |
|
81 |
|
82 echo This is file b22 > b |
|
83 echo %% merge fails |
|
84 hg merge 2 |
|
85 echo %% merge expected! |
|
86 hg merge -f 2 |
|
87 hg diff --nodates |
|
88 hg status |
|
89 cd ..; rm -r t |
|
90 |
|
91 mkdir t |
|
92 cd t |
|
93 hg init |
|
94 echo This is file a1 > a |
|
95 hg add a |
|
96 hg commit -m "commit #0" -d "1000000 0" |
|
97 echo This is file b1 > b |
|
98 hg add b |
|
99 hg commit -m "commit #1" -d "1000000 0" |
|
100 echo This is file b22 > b |
|
101 hg commit -m "commit #2" -d "1000000 0" |
|
102 hg update 1 |
|
103 echo This is file c1 > c |
|
104 hg add c |
|
105 hg commit -m "commit #3" -d "1000000 0" |
|
106 echo This is file b33 > b |
|
107 echo %% merge of b should fail |
|
108 hg merge 2 |
|
109 echo %% merge of b expected |
|
110 hg merge -f 2 |
|
111 hg diff --nodates |
|
112 hg status |
|