##// END OF EJS Templates
test-merge-changedelete.t: print out debugmergestate...
Siddharth Agarwal -
r27136:29b08ca6 default
parent child Browse files
Show More
@@ -1,230 +1,260
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 file3
13 > hg st -A file1 file2 file3
14 > echo "--- resolve --list ---"
14 > echo "--- resolve --list ---"
15 > hg resolve --list file1 file2 file3
15 > hg resolve --list file1 file2 file3
16 > echo "--- debugmergestate ---"
17 > hg debugmergestate
16 > for file in file1 file2 file3; do
18 > for file in file1 file2 file3; do
17 > if [ -f $file ]; then
19 > if [ -f $file ]; then
18 > echo "--- $file ---"
20 > echo "--- $file ---"
19 > cat $file
21 > cat $file
20 > else
22 > else
21 > echo "*** $file does not exist"
23 > echo "*** $file does not exist"
22 > fi
24 > fi
23 > done
25 > done
24 > }
26 > }
25
27
26 $ hg init
28 $ hg init
27
29
28 $ echo 1 > file1
30 $ echo 1 > file1
29 $ echo 2 > file2
31 $ echo 2 > file2
30 $ echo 3 > file3
32 $ echo 3 > file3
31 $ hg ci -Am 'added files'
33 $ hg ci -Am 'added files'
32 adding file1
34 adding file1
33 adding file2
35 adding file2
34 adding file3
36 adding file3
35
37
36 $ hg rm file1
38 $ hg rm file1
37 $ echo changed >> file2
39 $ echo changed >> file2
38 $ echo changed1 >> file3
40 $ echo changed1 >> file3
39 $ hg ci -m 'removed file1, changed file2, changed file3'
41 $ hg ci -m 'removed file1, changed file2, changed file3'
40
42
41 $ hg co 0
43 $ hg co 0
42 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
43
45
44 $ echo changed >> file1
46 $ echo changed >> file1
45 $ hg rm file2
47 $ hg rm file2
46 $ echo changed2 >> file3
48 $ echo changed2 >> file3
47 $ hg ci -m 'changed file1, removed file2, changed file3'
49 $ hg ci -m 'changed file1, removed file2, changed file3'
48 created new head
50 created new head
49
51
50
52
51 Non-interactive merge:
53 Non-interactive merge:
52
54
53 $ hg merge -y
55 $ hg merge -y
54 local changed file1 which remote deleted
56 local changed file1 which remote deleted
55 use (c)hanged version or (d)elete? c
57 use (c)hanged version or (d)elete? c
56 remote changed file2 which local deleted
58 remote changed file2 which local deleted
57 use (c)hanged version or leave (d)eleted? c
59 use (c)hanged version or leave (d)eleted? c
58 merging file3
60 merging file3
59 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
61 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
60 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
62 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
61 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
63 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
62 [1]
64 [1]
63
65
64 $ status
66 $ status
65 --- status ---
67 --- status ---
66 M file2
68 M file2
67 M file3
69 M file3
68 C file1
70 C file1
69 --- resolve --list ---
71 --- resolve --list ---
70 U file3
72 U file3
73 --- debugmergestate ---
74 * version 2 records
75 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
76 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
77 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
78 local path: file3 (flags "")
79 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
80 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
71 --- file1 ---
81 --- file1 ---
72 1
82 1
73 changed
83 changed
74 --- file2 ---
84 --- file2 ---
75 2
85 2
76 changed
86 changed
77 --- file3 ---
87 --- file3 ---
78 3
88 3
79 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
89 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
80 changed2
90 changed2
81 =======
91 =======
82 changed1
92 changed1
83 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
93 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
84
94
85
95
86 Interactive merge:
96 Interactive merge:
87
97
88 $ hg co -C
98 $ hg co -C
89 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
99 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
90
100
91 $ hg merge --config ui.interactive=true <<EOF
101 $ hg merge --config ui.interactive=true <<EOF
92 > c
102 > c
93 > d
103 > d
94 > EOF
104 > EOF
95 local changed file1 which remote deleted
105 local changed file1 which remote deleted
96 use (c)hanged version or (d)elete? c
106 use (c)hanged version or (d)elete? c
97 remote changed file2 which local deleted
107 remote changed file2 which local deleted
98 use (c)hanged version or leave (d)eleted? d
108 use (c)hanged version or leave (d)eleted? d
99 merging file3
109 merging file3
100 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
110 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
101 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
111 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
102 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
112 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
103 [1]
113 [1]
104
114
105 $ status
115 $ status
106 --- status ---
116 --- status ---
107 file2: * (glob)
117 file2: * (glob)
108 M file3
118 M file3
109 C file1
119 C file1
110 --- resolve --list ---
120 --- resolve --list ---
111 U file3
121 U file3
122 --- debugmergestate ---
123 * version 2 records
124 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
125 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
126 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
127 local path: file3 (flags "")
128 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
129 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
112 --- file1 ---
130 --- file1 ---
113 1
131 1
114 changed
132 changed
115 *** file2 does not exist
133 *** file2 does not exist
116 --- file3 ---
134 --- file3 ---
117 3
135 3
118 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
136 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
119 changed2
137 changed2
120 =======
138 =======
121 changed1
139 changed1
122 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
140 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
123
141
124
142
125 Interactive merge with bad input:
143 Interactive merge with bad input:
126
144
127 $ hg co -C
145 $ hg co -C
128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
129
147
130 $ hg merge --config ui.interactive=true <<EOF
148 $ hg merge --config ui.interactive=true <<EOF
131 > foo
149 > foo
132 > bar
150 > bar
133 > d
151 > d
134 > baz
152 > baz
135 > c
153 > c
136 > EOF
154 > EOF
137 local changed file1 which remote deleted
155 local changed file1 which remote deleted
138 use (c)hanged version or (d)elete? foo
156 use (c)hanged version or (d)elete? foo
139 unrecognized response
157 unrecognized response
140 local changed file1 which remote deleted
158 local changed file1 which remote deleted
141 use (c)hanged version or (d)elete? bar
159 use (c)hanged version or (d)elete? bar
142 unrecognized response
160 unrecognized response
143 local changed file1 which remote deleted
161 local changed file1 which remote deleted
144 use (c)hanged version or (d)elete? d
162 use (c)hanged version or (d)elete? d
145 remote changed file2 which local deleted
163 remote changed file2 which local deleted
146 use (c)hanged version or leave (d)eleted? baz
164 use (c)hanged version or leave (d)eleted? baz
147 unrecognized response
165 unrecognized response
148 remote changed file2 which local deleted
166 remote changed file2 which local deleted
149 use (c)hanged version or leave (d)eleted? c
167 use (c)hanged version or leave (d)eleted? c
150 merging file3
168 merging file3
151 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
169 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
152 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
170 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
153 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
171 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
154 [1]
172 [1]
155
173
156 $ status
174 $ status
157 --- status ---
175 --- status ---
158 M file2
176 M file2
159 M file3
177 M file3
160 R file1
178 R file1
161 --- resolve --list ---
179 --- resolve --list ---
162 U file3
180 U file3
181 --- debugmergestate ---
182 * version 2 records
183 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
184 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
185 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
186 local path: file3 (flags "")
187 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
188 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
163 *** file1 does not exist
189 *** file1 does not exist
164 --- file2 ---
190 --- file2 ---
165 2
191 2
166 changed
192 changed
167 --- file3 ---
193 --- file3 ---
168 3
194 3
169 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
195 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
170 changed2
196 changed2
171 =======
197 =======
172 changed1
198 changed1
173 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
199 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
174
200
175
201
176 Interactive merge with not enough input:
202 Interactive merge with not enough input:
177
203
178 $ hg co -C
204 $ hg co -C
179 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
180
206
181 $ hg merge --config ui.interactive=true <<EOF
207 $ hg merge --config ui.interactive=true <<EOF
182 > d
208 > d
183 > EOF
209 > EOF
184 local changed file1 which remote deleted
210 local changed file1 which remote deleted
185 use (c)hanged version or (d)elete? d
211 use (c)hanged version or (d)elete? d
186 remote changed file2 which local deleted
212 remote changed file2 which local deleted
187 use (c)hanged version or leave (d)eleted? abort: response expected
213 use (c)hanged version or leave (d)eleted? abort: response expected
188 [255]
214 [255]
189
215
190 $ status
216 $ status
191 --- status ---
217 --- status ---
192 file2: * (glob)
218 file2: * (glob)
193 C file1
219 C file1
194 C file3
220 C file3
195 --- resolve --list ---
221 --- resolve --list ---
222 --- debugmergestate ---
223 no merge state found
196 --- file1 ---
224 --- file1 ---
197 1
225 1
198 changed
226 changed
199 *** file2 does not exist
227 *** file2 does not exist
200 --- file3 ---
228 --- file3 ---
201 3
229 3
202 changed2
230 changed2
203
231
204 Non-interactive linear update
232 Non-interactive linear update
205
233
206 $ hg co -C 0
234 $ hg co -C 0
207 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 $ echo changed >> file1
236 $ echo changed >> file1
209 $ hg rm file2
237 $ hg rm file2
210 $ hg update 1 -y
238 $ hg update 1 -y
211 local changed file1 which remote deleted
239 local changed file1 which remote deleted
212 use (c)hanged version or (d)elete? c
240 use (c)hanged version or (d)elete? c
213 remote changed file2 which local deleted
241 remote changed file2 which local deleted
214 use (c)hanged version or leave (d)eleted? c
242 use (c)hanged version or leave (d)eleted? c
215 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 $ status
244 $ status
217 --- status ---
245 --- status ---
218 A file1
246 A file1
219 C file2
247 C file2
220 C file3
248 C file3
221 --- resolve --list ---
249 --- resolve --list ---
250 --- debugmergestate ---
251 no merge state found
222 --- file1 ---
252 --- file1 ---
223 1
253 1
224 changed
254 changed
225 --- file2 ---
255 --- file2 ---
226 2
256 2
227 changed
257 changed
228 --- file3 ---
258 --- file3 ---
229 3
259 3
230 changed1
260 changed1
General Comments 0
You need to be logged in to leave comments. Login now