##// END OF EJS Templates
test-merge-changedelete.t: add a file with regular merge conflicts...
Siddharth Agarwal -
r27125:969ca40c default
parent child Browse files
Show More
@@ -1,175 +1,220 b''
1 Test for
1 Test for
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 (issue897)
3 (issue897)
4
4
5 840e2b315c1f: Fix misleading error and prompts during update/merge
5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 (issue556)
6 (issue556)
7
7
8 Make sure HGMERGE doesn't interfere with the test
8 Make sure HGMERGE doesn't interfere with the test
9 $ unset HGMERGE
9 $ unset HGMERGE
10
10
11 $ status() {
11 $ status() {
12 > echo "--- status ---"
12 > echo "--- status ---"
13 > hg st -A file1 file2
13 > hg st -A file1 file2 file3
14 > for file in file1 file2; do
14 > for file in file1 file2 file3; do
15 > if [ -f $file ]; then
15 > if [ -f $file ]; then
16 > echo "--- $file ---"
16 > echo "--- $file ---"
17 > cat $file
17 > cat $file
18 > else
18 > else
19 > echo "*** $file does not exist"
19 > echo "*** $file does not exist"
20 > fi
20 > fi
21 > done
21 > done
22 > }
22 > }
23
23
24 $ hg init
24 $ hg init
25
25
26 $ echo 1 > file1
26 $ echo 1 > file1
27 $ echo 2 > file2
27 $ echo 2 > file2
28 $ hg ci -Am 'added file1 and file2'
28 $ echo 3 > file3
29 $ hg ci -Am 'added files'
29 adding file1
30 adding file1
30 adding file2
31 adding file2
32 adding file3
31
33
32 $ hg rm file1
34 $ hg rm file1
33 $ echo changed >> file2
35 $ echo changed >> file2
34 $ hg ci -m 'removed file1, changed file2'
36 $ echo changed1 >> file3
37 $ hg ci -m 'removed file1, changed file2, changed file3'
35
38
36 $ hg co 0
39 $ hg co 0
37 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
38
41
39 $ echo changed >> file1
42 $ echo changed >> file1
40 $ hg rm file2
43 $ hg rm file2
41 $ hg ci -m 'changed file1, removed file2'
44 $ echo changed2 >> file3
45 $ hg ci -m 'changed file1, removed file2, changed file3'
42 created new head
46 created new head
43
47
44
48
45 Non-interactive merge:
49 Non-interactive merge:
46
50
47 $ hg merge -y
51 $ hg merge -y
48 local changed file1 which remote deleted
52 local changed file1 which remote deleted
49 use (c)hanged version or (d)elete? c
53 use (c)hanged version or (d)elete? c
50 remote changed file2 which local deleted
54 remote changed file2 which local deleted
51 use (c)hanged version or leave (d)eleted? c
55 use (c)hanged version or leave (d)eleted? c
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 merging file3
53 (branch merge, don't forget to commit)
57 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
58 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
59 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
60 [1]
54
61
55 $ status
62 $ status
56 --- status ---
63 --- status ---
57 M file2
64 M file2
65 M file3
58 C file1
66 C file1
59 --- file1 ---
67 --- file1 ---
60 1
68 1
61 changed
69 changed
62 --- file2 ---
70 --- file2 ---
63 2
71 2
64 changed
72 changed
73 --- file3 ---
74 3
75 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
76 changed2
77 =======
78 changed1
79 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
65
80
66
81
67 Interactive merge:
82 Interactive merge:
68
83
69 $ hg co -C
84 $ hg co -C
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
71
86
72 $ hg merge --config ui.interactive=true <<EOF
87 $ hg merge --config ui.interactive=true <<EOF
73 > c
88 > c
74 > d
89 > d
75 > EOF
90 > EOF
76 local changed file1 which remote deleted
91 local changed file1 which remote deleted
77 use (c)hanged version or (d)elete? c
92 use (c)hanged version or (d)elete? c
78 remote changed file2 which local deleted
93 remote changed file2 which local deleted
79 use (c)hanged version or leave (d)eleted? d
94 use (c)hanged version or leave (d)eleted? d
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 merging file3
81 (branch merge, don't forget to commit)
96 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
98 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
99 [1]
82
100
83 $ status
101 $ status
84 --- status ---
102 --- status ---
85 file2: * (glob)
103 file2: * (glob)
104 M file3
86 C file1
105 C file1
87 --- file1 ---
106 --- file1 ---
88 1
107 1
89 changed
108 changed
90 *** file2 does not exist
109 *** file2 does not exist
110 --- file3 ---
111 3
112 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
113 changed2
114 =======
115 changed1
116 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
91
117
92
118
93 Interactive merge with bad input:
119 Interactive merge with bad input:
94
120
95 $ hg co -C
121 $ hg co -C
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97
123
98 $ hg merge --config ui.interactive=true <<EOF
124 $ hg merge --config ui.interactive=true <<EOF
99 > foo
125 > foo
100 > bar
126 > bar
101 > d
127 > d
102 > baz
128 > baz
103 > c
129 > c
104 > EOF
130 > EOF
105 local changed file1 which remote deleted
131 local changed file1 which remote deleted
106 use (c)hanged version or (d)elete? foo
132 use (c)hanged version or (d)elete? foo
107 unrecognized response
133 unrecognized response
108 local changed file1 which remote deleted
134 local changed file1 which remote deleted
109 use (c)hanged version or (d)elete? bar
135 use (c)hanged version or (d)elete? bar
110 unrecognized response
136 unrecognized response
111 local changed file1 which remote deleted
137 local changed file1 which remote deleted
112 use (c)hanged version or (d)elete? d
138 use (c)hanged version or (d)elete? d
113 remote changed file2 which local deleted
139 remote changed file2 which local deleted
114 use (c)hanged version or leave (d)eleted? baz
140 use (c)hanged version or leave (d)eleted? baz
115 unrecognized response
141 unrecognized response
116 remote changed file2 which local deleted
142 remote changed file2 which local deleted
117 use (c)hanged version or leave (d)eleted? c
143 use (c)hanged version or leave (d)eleted? c
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
144 merging file3
119 (branch merge, don't forget to commit)
145 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
146 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
147 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
148 [1]
120
149
121 $ status
150 $ status
122 --- status ---
151 --- status ---
123 M file2
152 M file2
153 M file3
124 R file1
154 R file1
125 *** file1 does not exist
155 *** file1 does not exist
126 --- file2 ---
156 --- file2 ---
127 2
157 2
128 changed
158 changed
159 --- file3 ---
160 3
161 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
162 changed2
163 =======
164 changed1
165 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
129
166
130
167
131 Interactive merge with not enough input:
168 Interactive merge with not enough input:
132
169
133 $ hg co -C
170 $ hg co -C
134 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
171 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
135
172
136 $ hg merge --config ui.interactive=true <<EOF
173 $ hg merge --config ui.interactive=true <<EOF
137 > d
174 > d
138 > EOF
175 > EOF
139 local changed file1 which remote deleted
176 local changed file1 which remote deleted
140 use (c)hanged version or (d)elete? d
177 use (c)hanged version or (d)elete? d
141 remote changed file2 which local deleted
178 remote changed file2 which local deleted
142 use (c)hanged version or leave (d)eleted? abort: response expected
179 use (c)hanged version or leave (d)eleted? abort: response expected
143 [255]
180 [255]
144
181
145 $ status
182 $ status
146 --- status ---
183 --- status ---
147 file2: * (glob)
184 file2: * (glob)
148 C file1
185 C file1
186 C file3
149 --- file1 ---
187 --- file1 ---
150 1
188 1
151 changed
189 changed
152 *** file2 does not exist
190 *** file2 does not exist
191 --- file3 ---
192 3
193 changed2
153
194
154 Non-interactive linear update
195 Non-interactive linear update
155
196
156 $ hg co -C 0
197 $ hg co -C 0
157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ echo changed >> file1
199 $ echo changed >> file1
159 $ hg rm file2
200 $ hg rm file2
160 $ hg update 1 -y
201 $ hg update 1 -y
161 local changed file1 which remote deleted
202 local changed file1 which remote deleted
162 use (c)hanged version or (d)elete? c
203 use (c)hanged version or (d)elete? c
163 remote changed file2 which local deleted
204 remote changed file2 which local deleted
164 use (c)hanged version or leave (d)eleted? c
205 use (c)hanged version or leave (d)eleted? c
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 $ status
207 $ status
167 --- status ---
208 --- status ---
168 A file1
209 A file1
169 C file2
210 C file2
211 C file3
170 --- file1 ---
212 --- file1 ---
171 1
213 1
172 changed
214 changed
173 --- file2 ---
215 --- file2 ---
174 2
216 2
175 changed
217 changed
218 --- file3 ---
219 3
220 changed1
General Comments 0
You need to be logged in to leave comments. Login now