##// END OF EJS Templates
test-mq-qrefresh: test that the patch at qtip is indeed empty...
Adrian Buehlmann -
r17978:55b367bf default
parent child Browse files
Show More
@@ -1,547 +1,548 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "[diff]" >> $HGRCPATH
3 $ echo "[diff]" >> $HGRCPATH
4 $ echo "nodates=1" >> $HGRCPATH
4 $ echo "nodates=1" >> $HGRCPATH
5
5
6 $ hg init a
6 $ hg init a
7 $ cd a
7 $ cd a
8
8
9 $ mkdir 1 2
9 $ mkdir 1 2
10 $ echo 'base' > 1/base
10 $ echo 'base' > 1/base
11 $ echo 'base' > 2/base
11 $ echo 'base' > 2/base
12 $ hg ci -Ambase
12 $ hg ci -Ambase
13 adding 1/base
13 adding 1/base
14 adding 2/base
14 adding 2/base
15
15
16 $ hg qnew -mmqbase mqbase
16 $ hg qnew -mmqbase mqbase
17
17
18 $ echo 'patched' > 1/base
18 $ echo 'patched' > 1/base
19 $ echo 'patched' > 2/base
19 $ echo 'patched' > 2/base
20 $ hg qrefresh
20 $ hg qrefresh
21
21
22 $ hg qdiff
22 $ hg qdiff
23 diff -r e7af5904b465 1/base
23 diff -r e7af5904b465 1/base
24 --- a/1/base
24 --- a/1/base
25 +++ b/1/base
25 +++ b/1/base
26 @@ -1,1 +1,1 @@
26 @@ -1,1 +1,1 @@
27 -base
27 -base
28 +patched
28 +patched
29 diff -r e7af5904b465 2/base
29 diff -r e7af5904b465 2/base
30 --- a/2/base
30 --- a/2/base
31 +++ b/2/base
31 +++ b/2/base
32 @@ -1,1 +1,1 @@
32 @@ -1,1 +1,1 @@
33 -base
33 -base
34 +patched
34 +patched
35
35
36 $ hg qdiff .
36 $ hg qdiff .
37 diff -r e7af5904b465 1/base
37 diff -r e7af5904b465 1/base
38 --- a/1/base
38 --- a/1/base
39 +++ b/1/base
39 +++ b/1/base
40 @@ -1,1 +1,1 @@
40 @@ -1,1 +1,1 @@
41 -base
41 -base
42 +patched
42 +patched
43 diff -r e7af5904b465 2/base
43 diff -r e7af5904b465 2/base
44 --- a/2/base
44 --- a/2/base
45 +++ b/2/base
45 +++ b/2/base
46 @@ -1,1 +1,1 @@
46 @@ -1,1 +1,1 @@
47 -base
47 -base
48 +patched
48 +patched
49
49
50 $ cat .hg/patches/mqbase
50 $ cat .hg/patches/mqbase
51 # HG changeset patch
51 # HG changeset patch
52 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
52 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
53 mqbase
53 mqbase
54
54
55 diff -r e7af5904b465 1/base
55 diff -r e7af5904b465 1/base
56 --- a/1/base
56 --- a/1/base
57 +++ b/1/base
57 +++ b/1/base
58 @@ -1,1 +1,1 @@
58 @@ -1,1 +1,1 @@
59 -base
59 -base
60 +patched
60 +patched
61 diff -r e7af5904b465 2/base
61 diff -r e7af5904b465 2/base
62 --- a/2/base
62 --- a/2/base
63 +++ b/2/base
63 +++ b/2/base
64 @@ -1,1 +1,1 @@
64 @@ -1,1 +1,1 @@
65 -base
65 -base
66 +patched
66 +patched
67
67
68 $ echo 'patched again' > base
68 $ echo 'patched again' > base
69 $ hg qrefresh 1
69 $ hg qrefresh 1
70
70
71 $ hg qdiff
71 $ hg qdiff
72 diff -r e7af5904b465 1/base
72 diff -r e7af5904b465 1/base
73 --- a/1/base
73 --- a/1/base
74 +++ b/1/base
74 +++ b/1/base
75 @@ -1,1 +1,1 @@
75 @@ -1,1 +1,1 @@
76 -base
76 -base
77 +patched
77 +patched
78 diff -r e7af5904b465 2/base
78 diff -r e7af5904b465 2/base
79 --- a/2/base
79 --- a/2/base
80 +++ b/2/base
80 +++ b/2/base
81 @@ -1,1 +1,1 @@
81 @@ -1,1 +1,1 @@
82 -base
82 -base
83 +patched
83 +patched
84
84
85 $ hg qdiff .
85 $ hg qdiff .
86 diff -r e7af5904b465 1/base
86 diff -r e7af5904b465 1/base
87 --- a/1/base
87 --- a/1/base
88 +++ b/1/base
88 +++ b/1/base
89 @@ -1,1 +1,1 @@
89 @@ -1,1 +1,1 @@
90 -base
90 -base
91 +patched
91 +patched
92 diff -r e7af5904b465 2/base
92 diff -r e7af5904b465 2/base
93 --- a/2/base
93 --- a/2/base
94 +++ b/2/base
94 +++ b/2/base
95 @@ -1,1 +1,1 @@
95 @@ -1,1 +1,1 @@
96 -base
96 -base
97 +patched
97 +patched
98
98
99 $ cat .hg/patches/mqbase
99 $ cat .hg/patches/mqbase
100 # HG changeset patch
100 # HG changeset patch
101 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
101 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
102 mqbase
102 mqbase
103
103
104 diff -r e7af5904b465 1/base
104 diff -r e7af5904b465 1/base
105 --- a/1/base
105 --- a/1/base
106 +++ b/1/base
106 +++ b/1/base
107 @@ -1,1 +1,1 @@
107 @@ -1,1 +1,1 @@
108 -base
108 -base
109 +patched
109 +patched
110
110
111 qrefresh . in subdir:
111 qrefresh . in subdir:
112
112
113 $ ( cd 1 ; hg qrefresh . )
113 $ ( cd 1 ; hg qrefresh . )
114
114
115 $ hg qdiff
115 $ hg qdiff
116 diff -r e7af5904b465 1/base
116 diff -r e7af5904b465 1/base
117 --- a/1/base
117 --- a/1/base
118 +++ b/1/base
118 +++ b/1/base
119 @@ -1,1 +1,1 @@
119 @@ -1,1 +1,1 @@
120 -base
120 -base
121 +patched
121 +patched
122 diff -r e7af5904b465 2/base
122 diff -r e7af5904b465 2/base
123 --- a/2/base
123 --- a/2/base
124 +++ b/2/base
124 +++ b/2/base
125 @@ -1,1 +1,1 @@
125 @@ -1,1 +1,1 @@
126 -base
126 -base
127 +patched
127 +patched
128
128
129 $ hg qdiff .
129 $ hg qdiff .
130 diff -r e7af5904b465 1/base
130 diff -r e7af5904b465 1/base
131 --- a/1/base
131 --- a/1/base
132 +++ b/1/base
132 +++ b/1/base
133 @@ -1,1 +1,1 @@
133 @@ -1,1 +1,1 @@
134 -base
134 -base
135 +patched
135 +patched
136 diff -r e7af5904b465 2/base
136 diff -r e7af5904b465 2/base
137 --- a/2/base
137 --- a/2/base
138 +++ b/2/base
138 +++ b/2/base
139 @@ -1,1 +1,1 @@
139 @@ -1,1 +1,1 @@
140 -base
140 -base
141 +patched
141 +patched
142
142
143 $ cat .hg/patches/mqbase
143 $ cat .hg/patches/mqbase
144 # HG changeset patch
144 # HG changeset patch
145 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
145 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
146 mqbase
146 mqbase
147
147
148 diff -r e7af5904b465 1/base
148 diff -r e7af5904b465 1/base
149 --- a/1/base
149 --- a/1/base
150 +++ b/1/base
150 +++ b/1/base
151 @@ -1,1 +1,1 @@
151 @@ -1,1 +1,1 @@
152 -base
152 -base
153 +patched
153 +patched
154
154
155 qrefresh in hg-root again:
155 qrefresh in hg-root again:
156
156
157 $ hg qrefresh
157 $ hg qrefresh
158
158
159 $ hg qdiff
159 $ hg qdiff
160 diff -r e7af5904b465 1/base
160 diff -r e7af5904b465 1/base
161 --- a/1/base
161 --- a/1/base
162 +++ b/1/base
162 +++ b/1/base
163 @@ -1,1 +1,1 @@
163 @@ -1,1 +1,1 @@
164 -base
164 -base
165 +patched
165 +patched
166 diff -r e7af5904b465 2/base
166 diff -r e7af5904b465 2/base
167 --- a/2/base
167 --- a/2/base
168 +++ b/2/base
168 +++ b/2/base
169 @@ -1,1 +1,1 @@
169 @@ -1,1 +1,1 @@
170 -base
170 -base
171 +patched
171 +patched
172
172
173 $ hg qdiff .
173 $ hg qdiff .
174 diff -r e7af5904b465 1/base
174 diff -r e7af5904b465 1/base
175 --- a/1/base
175 --- a/1/base
176 +++ b/1/base
176 +++ b/1/base
177 @@ -1,1 +1,1 @@
177 @@ -1,1 +1,1 @@
178 -base
178 -base
179 +patched
179 +patched
180 diff -r e7af5904b465 2/base
180 diff -r e7af5904b465 2/base
181 --- a/2/base
181 --- a/2/base
182 +++ b/2/base
182 +++ b/2/base
183 @@ -1,1 +1,1 @@
183 @@ -1,1 +1,1 @@
184 -base
184 -base
185 +patched
185 +patched
186
186
187 $ cat .hg/patches/mqbase
187 $ cat .hg/patches/mqbase
188 # HG changeset patch
188 # HG changeset patch
189 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
189 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
190 mqbase
190 mqbase
191
191
192 diff -r e7af5904b465 1/base
192 diff -r e7af5904b465 1/base
193 --- a/1/base
193 --- a/1/base
194 +++ b/1/base
194 +++ b/1/base
195 @@ -1,1 +1,1 @@
195 @@ -1,1 +1,1 @@
196 -base
196 -base
197 +patched
197 +patched
198 diff -r e7af5904b465 2/base
198 diff -r e7af5904b465 2/base
199 --- a/2/base
199 --- a/2/base
200 +++ b/2/base
200 +++ b/2/base
201 @@ -1,1 +1,1 @@
201 @@ -1,1 +1,1 @@
202 -base
202 -base
203 +patched
203 +patched
204
204
205
205
206 qrefresh --short tests:
206 qrefresh --short tests:
207
207
208 $ echo 'orphan' > orphanchild
208 $ echo 'orphan' > orphanchild
209 $ hg add orphanchild
209 $ hg add orphanchild
210 $ hg qrefresh nonexistentfilename # clear patch
210 $ hg qrefresh nonexistentfilename # clear patch
211 nonexistentfilename: * (glob)
211 nonexistentfilename: * (glob)
212 $ hg diff -c qtip
212 $ hg qrefresh --short 1/base
213 $ hg qrefresh --short 1/base
213 $ hg qrefresh --short 2/base
214 $ hg qrefresh --short 2/base
214
215
215 $ hg qdiff
216 $ hg qdiff
216 diff -r e7af5904b465 1/base
217 diff -r e7af5904b465 1/base
217 --- a/1/base
218 --- a/1/base
218 +++ b/1/base
219 +++ b/1/base
219 @@ -1,1 +1,1 @@
220 @@ -1,1 +1,1 @@
220 -base
221 -base
221 +patched
222 +patched
222 diff -r e7af5904b465 2/base
223 diff -r e7af5904b465 2/base
223 --- a/2/base
224 --- a/2/base
224 +++ b/2/base
225 +++ b/2/base
225 @@ -1,1 +1,1 @@
226 @@ -1,1 +1,1 @@
226 -base
227 -base
227 +patched
228 +patched
228 diff -r e7af5904b465 orphanchild
229 diff -r e7af5904b465 orphanchild
229 --- /dev/null
230 --- /dev/null
230 +++ b/orphanchild
231 +++ b/orphanchild
231 @@ -0,0 +1,1 @@
232 @@ -0,0 +1,1 @@
232 +orphan
233 +orphan
233
234
234 $ cat .hg/patches/mqbase
235 $ cat .hg/patches/mqbase
235 # HG changeset patch
236 # HG changeset patch
236 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
237 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
237 mqbase
238 mqbase
238
239
239 diff -r e7af5904b465 1/base
240 diff -r e7af5904b465 1/base
240 --- a/1/base
241 --- a/1/base
241 +++ b/1/base
242 +++ b/1/base
242 @@ -1,1 +1,1 @@
243 @@ -1,1 +1,1 @@
243 -base
244 -base
244 +patched
245 +patched
245 diff -r e7af5904b465 2/base
246 diff -r e7af5904b465 2/base
246 --- a/2/base
247 --- a/2/base
247 +++ b/2/base
248 +++ b/2/base
248 @@ -1,1 +1,1 @@
249 @@ -1,1 +1,1 @@
249 -base
250 -base
250 +patched
251 +patched
251
252
252 $ hg st
253 $ hg st
253 A orphanchild
254 A orphanchild
254 ? base
255 ? base
255
256
256 diff shows what is not in patch:
257 diff shows what is not in patch:
257
258
258 $ hg diff
259 $ hg diff
259 diff -r ???????????? orphanchild (glob)
260 diff -r ???????????? orphanchild (glob)
260 --- /dev/null
261 --- /dev/null
261 +++ b/orphanchild
262 +++ b/orphanchild
262 @@ -0,0 +1,1 @@
263 @@ -0,0 +1,1 @@
263 +orphan
264 +orphan
264
265
265 Before starting exclusive tests:
266 Before starting exclusive tests:
266
267
267 $ cat .hg/patches/mqbase
268 $ cat .hg/patches/mqbase
268 # HG changeset patch
269 # HG changeset patch
269 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
270 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
270 mqbase
271 mqbase
271
272
272 diff -r e7af5904b465 1/base
273 diff -r e7af5904b465 1/base
273 --- a/1/base
274 --- a/1/base
274 +++ b/1/base
275 +++ b/1/base
275 @@ -1,1 +1,1 @@
276 @@ -1,1 +1,1 @@
276 -base
277 -base
277 +patched
278 +patched
278 diff -r e7af5904b465 2/base
279 diff -r e7af5904b465 2/base
279 --- a/2/base
280 --- a/2/base
280 +++ b/2/base
281 +++ b/2/base
281 @@ -1,1 +1,1 @@
282 @@ -1,1 +1,1 @@
282 -base
283 -base
283 +patched
284 +patched
284
285
285 Exclude 2/base:
286 Exclude 2/base:
286
287
287 $ hg qref -s -X 2/base
288 $ hg qref -s -X 2/base
288
289
289 $ cat .hg/patches/mqbase
290 $ cat .hg/patches/mqbase
290 # HG changeset patch
291 # HG changeset patch
291 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
292 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
292 mqbase
293 mqbase
293
294
294 diff -r e7af5904b465 1/base
295 diff -r e7af5904b465 1/base
295 --- a/1/base
296 --- a/1/base
296 +++ b/1/base
297 +++ b/1/base
297 @@ -1,1 +1,1 @@
298 @@ -1,1 +1,1 @@
298 -base
299 -base
299 +patched
300 +patched
300
301
301 status shows 2/base as dirty:
302 status shows 2/base as dirty:
302
303
303 $ hg status
304 $ hg status
304 M 2/base
305 M 2/base
305 A orphanchild
306 A orphanchild
306 ? base
307 ? base
307
308
308 Remove 1/base and add 2/base again but not orphanchild:
309 Remove 1/base and add 2/base again but not orphanchild:
309
310
310 $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild
311 $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild
311
312
312 $ cat .hg/patches/mqbase
313 $ cat .hg/patches/mqbase
313 # HG changeset patch
314 # HG changeset patch
314 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
315 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
315 mqbase
316 mqbase
316
317
317 diff -r e7af5904b465 2/base
318 diff -r e7af5904b465 2/base
318 --- a/2/base
319 --- a/2/base
319 +++ b/2/base
320 +++ b/2/base
320 @@ -1,1 +1,1 @@
321 @@ -1,1 +1,1 @@
321 -base
322 -base
322 +patched
323 +patched
323
324
324 Add 1/base with include filter - and thus remove 2/base from patch:
325 Add 1/base with include filter - and thus remove 2/base from patch:
325
326
326 $ hg qref -s -I 1/ o* */*
327 $ hg qref -s -I 1/ o* */*
327
328
328 $ cat .hg/patches/mqbase
329 $ cat .hg/patches/mqbase
329 # HG changeset patch
330 # HG changeset patch
330 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
331 # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
331 mqbase
332 mqbase
332
333
333 diff -r e7af5904b465 1/base
334 diff -r e7af5904b465 1/base
334 --- a/1/base
335 --- a/1/base
335 +++ b/1/base
336 +++ b/1/base
336 @@ -1,1 +1,1 @@
337 @@ -1,1 +1,1 @@
337 -base
338 -base
338 +patched
339 +patched
339
340
340 $ cd ..
341 $ cd ..
341
342
342
343
343 Test qrefresh --git losing copy metadata:
344 Test qrefresh --git losing copy metadata:
344
345
345 $ hg init repo
346 $ hg init repo
346 $ cd repo
347 $ cd repo
347
348
348 $ echo "[diff]" >> .hg/hgrc
349 $ echo "[diff]" >> .hg/hgrc
349 $ echo "git=True" >> .hg/hgrc
350 $ echo "git=True" >> .hg/hgrc
350 $ echo a > a
351 $ echo a > a
351
352
352 $ hg ci -Am adda
353 $ hg ci -Am adda
353 adding a
354 adding a
354 $ hg copy a ab
355 $ hg copy a ab
355 $ echo b >> ab
356 $ echo b >> ab
356 $ hg copy a ac
357 $ hg copy a ac
357 $ echo c >> ac
358 $ echo c >> ac
358
359
359 Capture changes:
360 Capture changes:
360
361
361 $ hg qnew -f p1
362 $ hg qnew -f p1
362
363
363 $ hg qdiff
364 $ hg qdiff
364 diff --git a/a b/ab
365 diff --git a/a b/ab
365 copy from a
366 copy from a
366 copy to ab
367 copy to ab
367 --- a/a
368 --- a/a
368 +++ b/ab
369 +++ b/ab
369 @@ -1,1 +1,2 @@
370 @@ -1,1 +1,2 @@
370 a
371 a
371 +b
372 +b
372 diff --git a/a b/ac
373 diff --git a/a b/ac
373 copy from a
374 copy from a
374 copy to ac
375 copy to ac
375 --- a/a
376 --- a/a
376 +++ b/ac
377 +++ b/ac
377 @@ -1,1 +1,2 @@
378 @@ -1,1 +1,2 @@
378 a
379 a
379 +c
380 +c
380
381
381 Refresh and check changes again:
382 Refresh and check changes again:
382
383
383 $ hg qrefresh
384 $ hg qrefresh
384
385
385 $ hg qdiff
386 $ hg qdiff
386 diff --git a/a b/ab
387 diff --git a/a b/ab
387 copy from a
388 copy from a
388 copy to ab
389 copy to ab
389 --- a/a
390 --- a/a
390 +++ b/ab
391 +++ b/ab
391 @@ -1,1 +1,2 @@
392 @@ -1,1 +1,2 @@
392 a
393 a
393 +b
394 +b
394 diff --git a/a b/ac
395 diff --git a/a b/ac
395 copy from a
396 copy from a
396 copy to ac
397 copy to ac
397 --- a/a
398 --- a/a
398 +++ b/ac
399 +++ b/ac
399 @@ -1,1 +1,2 @@
400 @@ -1,1 +1,2 @@
400 a
401 a
401 +c
402 +c
402
403
403 $ cd ..
404 $ cd ..
404
405
405
406
406 Issue1441: qrefresh confused after hg rename:
407 Issue1441: qrefresh confused after hg rename:
407
408
408 $ hg init repo-1441
409 $ hg init repo-1441
409 $ cd repo-1441
410 $ cd repo-1441
410 $ echo a > a
411 $ echo a > a
411 $ hg add a
412 $ hg add a
412 $ hg qnew -f p
413 $ hg qnew -f p
413 $ hg mv a b
414 $ hg mv a b
414 $ hg qrefresh
415 $ hg qrefresh
415
416
416 $ hg qdiff
417 $ hg qdiff
417 diff -r 000000000000 b
418 diff -r 000000000000 b
418 --- /dev/null
419 --- /dev/null
419 +++ b/b
420 +++ b/b
420 @@ -0,0 +1,1 @@
421 @@ -0,0 +1,1 @@
421 +a
422 +a
422
423
423 $ cd ..
424 $ cd ..
424
425
425
426
426 Issue2025: qrefresh does not honor filtering options when tip !=
427 Issue2025: qrefresh does not honor filtering options when tip !=
427 qtip:
428 qtip:
428
429
429 $ hg init repo-2025
430 $ hg init repo-2025
430 $ cd repo-2025
431 $ cd repo-2025
431 $ echo a > a
432 $ echo a > a
432 $ echo b > b
433 $ echo b > b
433 $ hg ci -qAm addab
434 $ hg ci -qAm addab
434 $ echo a >> a
435 $ echo a >> a
435 $ echo b >> b
436 $ echo b >> b
436 $ hg qnew -f patch
437 $ hg qnew -f patch
437 $ hg up -qC 0
438 $ hg up -qC 0
438 $ echo c > c
439 $ echo c > c
439 $ hg ci -qAm addc
440 $ hg ci -qAm addc
440 $ hg up -qC 1
441 $ hg up -qC 1
441
442
442 refresh with tip != qtip:
443 refresh with tip != qtip:
443
444
444 $ hg --config diff.nodates=1 qrefresh -I b
445 $ hg --config diff.nodates=1 qrefresh -I b
445
446
446 $ hg st
447 $ hg st
447 M a
448 M a
448
449
449 $ cat b
450 $ cat b
450 b
451 b
451 b
452 b
452
453
453 $ cat .hg/patches/patch
454 $ cat .hg/patches/patch
454 # HG changeset patch
455 # HG changeset patch
455 # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
456 # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
456
457
457 diff -r 1a60229be7ac b
458 diff -r 1a60229be7ac b
458 --- a/b
459 --- a/b
459 +++ b/b
460 +++ b/b
460 @@ -1,1 +1,2 @@
461 @@ -1,1 +1,2 @@
461 b
462 b
462 +b
463 +b
463
464
464 $ cd ..
465 $ cd ..
465
466
466
467
467 Issue1441 with git patches:
468 Issue1441 with git patches:
468
469
469 $ hg init repo-1441-git
470 $ hg init repo-1441-git
470 $ cd repo-1441-git
471 $ cd repo-1441-git
471
472
472 $ echo "[diff]" >> .hg/hgrc
473 $ echo "[diff]" >> .hg/hgrc
473 $ echo "git=True" >> .hg/hgrc
474 $ echo "git=True" >> .hg/hgrc
474
475
475 $ echo a > a
476 $ echo a > a
476 $ hg add a
477 $ hg add a
477 $ hg qnew -f p
478 $ hg qnew -f p
478 $ hg mv a b
479 $ hg mv a b
479 $ hg qrefresh
480 $ hg qrefresh
480
481
481 $ hg qdiff --nodates
482 $ hg qdiff --nodates
482 diff --git a/b b/b
483 diff --git a/b b/b
483 new file mode 100644
484 new file mode 100644
484 --- /dev/null
485 --- /dev/null
485 +++ b/b
486 +++ b/b
486 @@ -0,0 +1,1 @@
487 @@ -0,0 +1,1 @@
487 +a
488 +a
488
489
489 $ cd ..
490 $ cd ..
490
491
491 Refresh with bad usernames. Mercurial used to abort on bad usernames,
492 Refresh with bad usernames. Mercurial used to abort on bad usernames,
492 but only after writing the bad name into the patch.
493 but only after writing the bad name into the patch.
493
494
494 $ hg init bad-usernames
495 $ hg init bad-usernames
495 $ cd bad-usernames
496 $ cd bad-usernames
496 $ touch a
497 $ touch a
497 $ hg add a
498 $ hg add a
498 $ hg qnew a
499 $ hg qnew a
499 $ hg qrefresh -u 'foo
500 $ hg qrefresh -u 'foo
500 > bar'
501 > bar'
501 transaction abort!
502 transaction abort!
502 rollback completed
503 rollback completed
503 refresh interrupted while patch was popped! (revert --all, qpush to recover)
504 refresh interrupted while patch was popped! (revert --all, qpush to recover)
504 abort: username 'foo\nbar' contains a newline!
505 abort: username 'foo\nbar' contains a newline!
505 [255]
506 [255]
506 $ rm a
507 $ rm a
507 $ cat .hg/patches/a
508 $ cat .hg/patches/a
508 # HG changeset patch
509 # HG changeset patch
509 # Parent 0000000000000000000000000000000000000000
510 # Parent 0000000000000000000000000000000000000000
510 diff --git a/a b/a
511 diff --git a/a b/a
511 new file mode 100644
512 new file mode 100644
512 $ hg qpush
513 $ hg qpush
513 applying a
514 applying a
514 now at: a
515 now at: a
515 $ hg qrefresh -u ' '
516 $ hg qrefresh -u ' '
516 transaction abort!
517 transaction abort!
517 rollback completed
518 rollback completed
518 refresh interrupted while patch was popped! (revert --all, qpush to recover)
519 refresh interrupted while patch was popped! (revert --all, qpush to recover)
519 abort: empty username!
520 abort: empty username!
520 [255]
521 [255]
521 $ cat .hg/patches/a
522 $ cat .hg/patches/a
522 # HG changeset patch
523 # HG changeset patch
523 # Parent 0000000000000000000000000000000000000000
524 # Parent 0000000000000000000000000000000000000000
524 diff --git a/a b/a
525 diff --git a/a b/a
525 new file mode 100644
526 new file mode 100644
526 $ cd ..
527 $ cd ..
527
528
528 Refresh with phase data:
529 Refresh with phase data:
529
530
530
531
531
532
532 $ cd repo
533 $ cd repo
533 $ echo 'babar' >> a
534 $ echo 'babar' >> a
534 $ hg qnew -m 'update a' p2.diff
535 $ hg qnew -m 'update a' p2.diff
535 $ hg phase p2.diff
536 $ hg phase p2.diff
536 2: draft
537 2: draft
537 $ echo 'beber' >> a
538 $ echo 'beber' >> a
538 $ hg qref
539 $ hg qref
539 $ hg phase p2.diff
540 $ hg phase p2.diff
540 2: draft
541 2: draft
541 $ hg phase --force --secret p2.diff
542 $ hg phase --force --secret p2.diff
542 $ echo 'bibir' >> a
543 $ echo 'bibir' >> a
543 $ hg qref
544 $ hg qref
544 $ hg phase p2.diff
545 $ hg phase p2.diff
545 2: secret
546 2: secret
546
547
547 $ cd ..
548 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now