##// END OF EJS Templates
tests: fix portability of sed usage in test-mq...
FUJIWARA Katsunori -
r16331:900767df stable
parent child Browse files
Show More
@@ -1,1510 +1,1515 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 $ "$TESTDIR/hghave" execbit || exit 80
2
2
3 $ checkundo()
3 $ checkundo()
4 > {
4 > {
5 > if [ -f .hg/store/undo ]; then
5 > if [ -f .hg/store/undo ]; then
6 > echo ".hg/store/undo still exists after $1"
6 > echo ".hg/store/undo still exists after $1"
7 > fi
7 > fi
8 > }
8 > }
9
9
10 $ echo "[extensions]" >> $HGRCPATH
10 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
12
12
13 $ echo "[mq]" >> $HGRCPATH
13 $ echo "[mq]" >> $HGRCPATH
14 $ echo "plain=true" >> $HGRCPATH
14 $ echo "plain=true" >> $HGRCPATH
15
15
16
16
17 help
17 help
18
18
19 $ hg help mq
19 $ hg help mq
20 mq extension - manage a stack of patches
20 mq extension - manage a stack of patches
21
21
22 This extension lets you work with a stack of patches in a Mercurial
22 This extension lets you work with a stack of patches in a Mercurial
23 repository. It manages two stacks of patches - all known patches, and applied
23 repository. It manages two stacks of patches - all known patches, and applied
24 patches (subset of known patches).
24 patches (subset of known patches).
25
25
26 Known patches are represented as patch files in the .hg/patches directory.
26 Known patches are represented as patch files in the .hg/patches directory.
27 Applied patches are both patch files and changesets.
27 Applied patches are both patch files and changesets.
28
28
29 Common tasks (use "hg help command" for more details):
29 Common tasks (use "hg help command" for more details):
30
30
31 create new patch qnew
31 create new patch qnew
32 import existing patch qimport
32 import existing patch qimport
33
33
34 print patch series qseries
34 print patch series qseries
35 print applied patches qapplied
35 print applied patches qapplied
36
36
37 add known patch to applied stack qpush
37 add known patch to applied stack qpush
38 remove patch from applied stack qpop
38 remove patch from applied stack qpop
39 refresh contents of top applied patch qrefresh
39 refresh contents of top applied patch qrefresh
40
40
41 By default, mq will automatically use git patches when required to avoid
41 By default, mq will automatically use git patches when required to avoid
42 losing file mode changes, copy records, binary files or empty files creations
42 losing file mode changes, copy records, binary files or empty files creations
43 or deletions. This behaviour can be configured with:
43 or deletions. This behaviour can be configured with:
44
44
45 [mq]
45 [mq]
46 git = auto/keep/yes/no
46 git = auto/keep/yes/no
47
47
48 If set to 'keep', mq will obey the [diff] section configuration while
48 If set to 'keep', mq will obey the [diff] section configuration while
49 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
49 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
50 will override the [diff] section and always generate git or regular patches,
50 will override the [diff] section and always generate git or regular patches,
51 possibly losing data in the second case.
51 possibly losing data in the second case.
52
52
53 It may be desirable for mq changesets to be kept in the secret phase (see "hg
53 It may be desirable for mq changesets to be kept in the secret phase (see "hg
54 help phases"), which can be enabled with the following setting:
54 help phases"), which can be enabled with the following setting:
55
55
56 [mq]
56 [mq]
57 secret = True
57 secret = True
58
58
59 You will by default be managing a patch queue named "patches". You can create
59 You will by default be managing a patch queue named "patches". You can create
60 other, independent patch queues with the "hg qqueue" command.
60 other, independent patch queues with the "hg qqueue" command.
61
61
62 list of commands:
62 list of commands:
63
63
64 qapplied print the patches already applied
64 qapplied print the patches already applied
65 qclone clone main and patch repository at same time
65 qclone clone main and patch repository at same time
66 qdelete remove patches from queue
66 qdelete remove patches from queue
67 qdiff diff of the current patch and subsequent modifications
67 qdiff diff of the current patch and subsequent modifications
68 qfinish move applied patches into repository history
68 qfinish move applied patches into repository history
69 qfold fold the named patches into the current patch
69 qfold fold the named patches into the current patch
70 qgoto push or pop patches until named patch is at top of stack
70 qgoto push or pop patches until named patch is at top of stack
71 qguard set or print guards for a patch
71 qguard set or print guards for a patch
72 qheader print the header of the topmost or specified patch
72 qheader print the header of the topmost or specified patch
73 qimport import a patch
73 qimport import a patch
74 qnew create a new patch
74 qnew create a new patch
75 qnext print the name of the next pushable patch
75 qnext print the name of the next pushable patch
76 qpop pop the current patch off the stack
76 qpop pop the current patch off the stack
77 qprev print the name of the preceding applied patch
77 qprev print the name of the preceding applied patch
78 qpush push the next patch onto the stack
78 qpush push the next patch onto the stack
79 qqueue manage multiple patch queues
79 qqueue manage multiple patch queues
80 qrefresh update the current patch
80 qrefresh update the current patch
81 qrename rename a patch
81 qrename rename a patch
82 qselect set or print guarded patches to push
82 qselect set or print guarded patches to push
83 qseries print the entire series file
83 qseries print the entire series file
84 qtop print the name of the current patch
84 qtop print the name of the current patch
85 qunapplied print the patches not yet applied
85 qunapplied print the patches not yet applied
86 strip strip changesets and all their descendants from the repository
86 strip strip changesets and all their descendants from the repository
87
87
88 use "hg -v help mq" to show builtin aliases and global options
88 use "hg -v help mq" to show builtin aliases and global options
89
89
90 $ hg init a
90 $ hg init a
91 $ cd a
91 $ cd a
92 $ echo a > a
92 $ echo a > a
93 $ hg ci -Ama
93 $ hg ci -Ama
94 adding a
94 adding a
95
95
96 $ hg clone . ../k
96 $ hg clone . ../k
97 updating to branch default
97 updating to branch default
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99
99
100 $ mkdir b
100 $ mkdir b
101 $ echo z > b/z
101 $ echo z > b/z
102 $ hg ci -Ama
102 $ hg ci -Ama
103 adding b/z
103 adding b/z
104
104
105
105
106 qinit
106 qinit
107
107
108 $ hg qinit
108 $ hg qinit
109
109
110 $ cd ..
110 $ cd ..
111 $ hg init b
111 $ hg init b
112
112
113
113
114 -R qinit
114 -R qinit
115
115
116 $ hg -R b qinit
116 $ hg -R b qinit
117
117
118 $ hg init c
118 $ hg init c
119
119
120
120
121 qinit -c
121 qinit -c
122
122
123 $ hg --cwd c qinit -c
123 $ hg --cwd c qinit -c
124 $ hg -R c/.hg/patches st
124 $ hg -R c/.hg/patches st
125 A .hgignore
125 A .hgignore
126 A series
126 A series
127
127
128
128
129 qinit; qinit -c
129 qinit; qinit -c
130
130
131 $ hg init d
131 $ hg init d
132 $ cd d
132 $ cd d
133 $ hg qinit
133 $ hg qinit
134 $ hg qinit -c
134 $ hg qinit -c
135
135
136 qinit -c should create both files if they don't exist
136 qinit -c should create both files if they don't exist
137
137
138 $ cat .hg/patches/.hgignore
138 $ cat .hg/patches/.hgignore
139 ^\.hg
139 ^\.hg
140 ^\.mq
140 ^\.mq
141 syntax: glob
141 syntax: glob
142 status
142 status
143 guards
143 guards
144 $ cat .hg/patches/series
144 $ cat .hg/patches/series
145 $ hg qinit -c
145 $ hg qinit -c
146 abort: repository $TESTTMP/d/.hg/patches already exists! (glob)
146 abort: repository $TESTTMP/d/.hg/patches already exists! (glob)
147 [255]
147 [255]
148 $ cd ..
148 $ cd ..
149
149
150 $ echo '% qinit; <stuff>; qinit -c'
150 $ echo '% qinit; <stuff>; qinit -c'
151 % qinit; <stuff>; qinit -c
151 % qinit; <stuff>; qinit -c
152 $ hg init e
152 $ hg init e
153 $ cd e
153 $ cd e
154 $ hg qnew A
154 $ hg qnew A
155 $ checkundo qnew
155 $ checkundo qnew
156 $ echo foo > foo
156 $ echo foo > foo
157 $ hg phase -r qbase
157 $ hg phase -r qbase
158 0: draft
158 0: draft
159 $ hg add foo
159 $ hg add foo
160 $ hg qrefresh
160 $ hg qrefresh
161 $ hg phase -r qbase
161 $ hg phase -r qbase
162 0: draft
162 0: draft
163 $ hg qnew B
163 $ hg qnew B
164 $ echo >> foo
164 $ echo >> foo
165 $ hg qrefresh
165 $ hg qrefresh
166 $ echo status >> .hg/patches/.hgignore
166 $ echo status >> .hg/patches/.hgignore
167 $ echo bleh >> .hg/patches/.hgignore
167 $ echo bleh >> .hg/patches/.hgignore
168 $ hg qinit -c
168 $ hg qinit -c
169 adding .hg/patches/A (glob)
169 adding .hg/patches/A (glob)
170 adding .hg/patches/B (glob)
170 adding .hg/patches/B (glob)
171 $ hg -R .hg/patches status
171 $ hg -R .hg/patches status
172 A .hgignore
172 A .hgignore
173 A A
173 A A
174 A B
174 A B
175 A series
175 A series
176
176
177 qinit -c shouldn't touch these files if they already exist
177 qinit -c shouldn't touch these files if they already exist
178
178
179 $ cat .hg/patches/.hgignore
179 $ cat .hg/patches/.hgignore
180 status
180 status
181 bleh
181 bleh
182 $ cat .hg/patches/series
182 $ cat .hg/patches/series
183 A
183 A
184 B
184 B
185
185
186 add an untracked file
186 add an untracked file
187
187
188 $ echo >> .hg/patches/flaf
188 $ echo >> .hg/patches/flaf
189
189
190 status --mq with color (issue2096)
190 status --mq with color (issue2096)
191
191
192 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
192 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
193 \x1b[0;32;1mA .hgignore\x1b[0m (esc)
193 \x1b[0;32;1mA .hgignore\x1b[0m (esc)
194 \x1b[0;32;1mA A\x1b[0m (esc)
194 \x1b[0;32;1mA A\x1b[0m (esc)
195 \x1b[0;32;1mA B\x1b[0m (esc)
195 \x1b[0;32;1mA B\x1b[0m (esc)
196 \x1b[0;32;1mA series\x1b[0m (esc)
196 \x1b[0;32;1mA series\x1b[0m (esc)
197 \x1b[0;35;1;4m? flaf\x1b[0m (esc)
197 \x1b[0;35;1;4m? flaf\x1b[0m (esc)
198
198
199 try the --mq option on a command provided by an extension
199 try the --mq option on a command provided by an extension
200
200
201 $ hg purge --mq --verbose --config extensions.purge=
201 $ hg purge --mq --verbose --config extensions.purge=
202 Removing file flaf
202 Removing file flaf
203
203
204 $ cd ..
204 $ cd ..
205
205
206 init --mq without repo
206 init --mq without repo
207
207
208 $ mkdir f
208 $ mkdir f
209 $ cd f
209 $ cd f
210 $ hg init --mq
210 $ hg init --mq
211 abort: there is no Mercurial repository here (.hg not found)
211 abort: there is no Mercurial repository here (.hg not found)
212 [255]
212 [255]
213 $ cd ..
213 $ cd ..
214
214
215 init --mq with repo path
215 init --mq with repo path
216
216
217 $ hg init g
217 $ hg init g
218 $ hg init --mq g
218 $ hg init --mq g
219 $ test -d g/.hg/patches/.hg
219 $ test -d g/.hg/patches/.hg
220
220
221 init --mq with nonexistent directory
221 init --mq with nonexistent directory
222
222
223 $ hg init --mq nonexistentdir
223 $ hg init --mq nonexistentdir
224 abort: repository nonexistentdir not found!
224 abort: repository nonexistentdir not found!
225 [255]
225 [255]
226
226
227
227
228 init --mq with bundle (non "local")
228 init --mq with bundle (non "local")
229
229
230 $ hg -R a bundle --all a.bundle >/dev/null
230 $ hg -R a bundle --all a.bundle >/dev/null
231 $ hg init --mq a.bundle
231 $ hg init --mq a.bundle
232 abort: only a local queue repository may be initialized
232 abort: only a local queue repository may be initialized
233 [255]
233 [255]
234
234
235 $ cd a
235 $ cd a
236
236
237 $ hg qnew -m 'foo bar' test.patch
237 $ hg qnew -m 'foo bar' test.patch
238
238
239 $ echo '# comment' > .hg/patches/series.tmp
239 $ echo '# comment' > .hg/patches/series.tmp
240 $ echo >> .hg/patches/series.tmp # empty line
240 $ echo >> .hg/patches/series.tmp # empty line
241 $ cat .hg/patches/series >> .hg/patches/series.tmp
241 $ cat .hg/patches/series >> .hg/patches/series.tmp
242 $ mv .hg/patches/series.tmp .hg/patches/series
242 $ mv .hg/patches/series.tmp .hg/patches/series
243
243
244
244
245 qrefresh
245 qrefresh
246
246
247 $ echo a >> a
247 $ echo a >> a
248 $ hg qrefresh
248 $ hg qrefresh
249 $ cat .hg/patches/test.patch
249 $ cat .hg/patches/test.patch
250 foo bar
250 foo bar
251
251
252 diff -r [a-f0-9]* a (re)
252 diff -r [a-f0-9]* a (re)
253 --- a/a\t(?P<date>.*) (re)
253 --- a/a\t(?P<date>.*) (re)
254 \+\+\+ b/a\t(?P<date2>.*) (re)
254 \+\+\+ b/a\t(?P<date2>.*) (re)
255 @@ -1,1 +1,2 @@
255 @@ -1,1 +1,2 @@
256 a
256 a
257 +a
257 +a
258
258
259 empty qrefresh
259 empty qrefresh
260
260
261 $ hg qrefresh -X a
261 $ hg qrefresh -X a
262
262
263 revision:
263 revision:
264
264
265 $ hg diff -r -2 -r -1
265 $ hg diff -r -2 -r -1
266
266
267 patch:
267 patch:
268
268
269 $ cat .hg/patches/test.patch
269 $ cat .hg/patches/test.patch
270 foo bar
270 foo bar
271
271
272
272
273 working dir diff:
273 working dir diff:
274
274
275 $ hg diff --nodates -q
275 $ hg diff --nodates -q
276 --- a/a
276 --- a/a
277 +++ b/a
277 +++ b/a
278 @@ -1,1 +1,2 @@
278 @@ -1,1 +1,2 @@
279 a
279 a
280 +a
280 +a
281
281
282 restore things
282 restore things
283
283
284 $ hg qrefresh
284 $ hg qrefresh
285 $ checkundo qrefresh
285 $ checkundo qrefresh
286
286
287
287
288 qpop
288 qpop
289
289
290 $ hg qpop
290 $ hg qpop
291 popping test.patch
291 popping test.patch
292 patch queue now empty
292 patch queue now empty
293 $ checkundo qpop
293 $ checkundo qpop
294
294
295
295
296 qpush with dump of tag cache
296 qpush with dump of tag cache
297 Dump the tag cache to ensure that it has exactly one head after qpush.
297 Dump the tag cache to ensure that it has exactly one head after qpush.
298
298
299 $ rm -f .hg/cache/tags
299 $ rm -f .hg/cache/tags
300 $ hg tags > /dev/null
300 $ hg tags > /dev/null
301
301
302 .hg/cache/tags (pre qpush):
302 .hg/cache/tags (pre qpush):
303
303
304 $ cat .hg/cache/tags
304 $ cat .hg/cache/tags
305 1 [\da-f]{40} (re)
305 1 [\da-f]{40} (re)
306
306
307 $ hg qpush
307 $ hg qpush
308 applying test.patch
308 applying test.patch
309 now at: test.patch
309 now at: test.patch
310 $ hg phase -r qbase
310 $ hg phase -r qbase
311 2: draft
311 2: draft
312 $ hg tags > /dev/null
312 $ hg tags > /dev/null
313
313
314 .hg/cache/tags (post qpush):
314 .hg/cache/tags (post qpush):
315
315
316 $ cat .hg/cache/tags
316 $ cat .hg/cache/tags
317 2 [\da-f]{40} (re)
317 2 [\da-f]{40} (re)
318
318
319 $ checkundo qpush
319 $ checkundo qpush
320 $ cd ..
320 $ cd ..
321
321
322
322
323 pop/push outside repo
323 pop/push outside repo
324 $ hg -R a qpop
324 $ hg -R a qpop
325 popping test.patch
325 popping test.patch
326 patch queue now empty
326 patch queue now empty
327 $ hg -R a qpush
327 $ hg -R a qpush
328 applying test.patch
328 applying test.patch
329 now at: test.patch
329 now at: test.patch
330
330
331 $ cd a
331 $ cd a
332 $ hg qnew test2.patch
332 $ hg qnew test2.patch
333
333
334 qrefresh in subdir
334 qrefresh in subdir
335
335
336 $ cd b
336 $ cd b
337 $ echo a > a
337 $ echo a > a
338 $ hg add a
338 $ hg add a
339 $ hg qrefresh
339 $ hg qrefresh
340
340
341 pop/push -a in subdir
341 pop/push -a in subdir
342
342
343 $ hg qpop -a
343 $ hg qpop -a
344 popping test2.patch
344 popping test2.patch
345 popping test.patch
345 popping test.patch
346 patch queue now empty
346 patch queue now empty
347 $ hg --traceback qpush -a
347 $ hg --traceback qpush -a
348 applying test.patch
348 applying test.patch
349 applying test2.patch
349 applying test2.patch
350 now at: test2.patch
350 now at: test2.patch
351
351
352
352
353 setting columns & formatted tests truncating (issue1912)
353 setting columns & formatted tests truncating (issue1912)
354
354
355 $ COLUMNS=4 hg qseries --config ui.formatted=true
355 $ COLUMNS=4 hg qseries --config ui.formatted=true
356 test.patch
356 test.patch
357 test2.patch
357 test2.patch
358 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
358 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
359 0 A test.patch: f...
359 0 A test.patch: f...
360 1 A test2.patch:
360 1 A test2.patch:
361 $ hg qpop
361 $ hg qpop
362 popping test2.patch
362 popping test2.patch
363 now at: test.patch
363 now at: test.patch
364 $ hg qseries -vs
364 $ hg qseries -vs
365 0 A test.patch: foo bar
365 0 A test.patch: foo bar
366 1 U test2.patch:
366 1 U test2.patch:
367 $ hg sum | grep mq
367 $ hg sum | grep mq
368 mq: 1 applied, 1 unapplied
368 mq: 1 applied, 1 unapplied
369 $ hg qpush
369 $ hg qpush
370 applying test2.patch
370 applying test2.patch
371 now at: test2.patch
371 now at: test2.patch
372 $ hg sum | grep mq
372 $ hg sum | grep mq
373 mq: 2 applied
373 mq: 2 applied
374 $ hg qapplied
374 $ hg qapplied
375 test.patch
375 test.patch
376 test2.patch
376 test2.patch
377 $ hg qtop
377 $ hg qtop
378 test2.patch
378 test2.patch
379
379
380
380
381 prev
381 prev
382
382
383 $ hg qapp -1
383 $ hg qapp -1
384 test.patch
384 test.patch
385
385
386 next
386 next
387
387
388 $ hg qunapp -1
388 $ hg qunapp -1
389 all patches applied
389 all patches applied
390 [1]
390 [1]
391
391
392 $ hg qpop
392 $ hg qpop
393 popping test2.patch
393 popping test2.patch
394 now at: test.patch
394 now at: test.patch
395
395
396 commit should fail
396 commit should fail
397
397
398 $ hg commit
398 $ hg commit
399 abort: cannot commit over an applied mq patch
399 abort: cannot commit over an applied mq patch
400 [255]
400 [255]
401
401
402 push should fail if draft
402 push should fail if draft
403
403
404 $ hg push ../../k
404 $ hg push ../../k
405 pushing to ../../k
405 pushing to ../../k
406 abort: source has mq patches applied
406 abort: source has mq patches applied
407 [255]
407 [255]
408
408
409
409
410 import should fail
410 import should fail
411
411
412 $ hg st .
412 $ hg st .
413 $ echo foo >> ../a
413 $ echo foo >> ../a
414 $ hg diff > ../../import.diff
414 $ hg diff > ../../import.diff
415 $ hg revert --no-backup ../a
415 $ hg revert --no-backup ../a
416 $ hg import ../../import.diff
416 $ hg import ../../import.diff
417 abort: cannot import over an applied patch
417 abort: cannot import over an applied patch
418 [255]
418 [255]
419 $ hg st
419 $ hg st
420
420
421 import --no-commit should succeed
421 import --no-commit should succeed
422
422
423 $ hg import --no-commit ../../import.diff
423 $ hg import --no-commit ../../import.diff
424 applying ../../import.diff
424 applying ../../import.diff
425 $ hg st
425 $ hg st
426 M a
426 M a
427 $ hg revert --no-backup ../a
427 $ hg revert --no-backup ../a
428
428
429
429
430 qunapplied
430 qunapplied
431
431
432 $ hg qunapplied
432 $ hg qunapplied
433 test2.patch
433 test2.patch
434
434
435
435
436 qpush/qpop with index
436 qpush/qpop with index
437
437
438 $ hg qnew test1b.patch
438 $ hg qnew test1b.patch
439 $ echo 1b > 1b
439 $ echo 1b > 1b
440 $ hg add 1b
440 $ hg add 1b
441 $ hg qrefresh
441 $ hg qrefresh
442 $ hg qpush 2
442 $ hg qpush 2
443 applying test2.patch
443 applying test2.patch
444 now at: test2.patch
444 now at: test2.patch
445 $ hg qpop 0
445 $ hg qpop 0
446 popping test2.patch
446 popping test2.patch
447 popping test1b.patch
447 popping test1b.patch
448 now at: test.patch
448 now at: test.patch
449 $ hg qpush test.patch+1
449 $ hg qpush test.patch+1
450 applying test1b.patch
450 applying test1b.patch
451 now at: test1b.patch
451 now at: test1b.patch
452 $ hg qpush test.patch+2
452 $ hg qpush test.patch+2
453 applying test2.patch
453 applying test2.patch
454 now at: test2.patch
454 now at: test2.patch
455 $ hg qpop test2.patch-1
455 $ hg qpop test2.patch-1
456 popping test2.patch
456 popping test2.patch
457 now at: test1b.patch
457 now at: test1b.patch
458 $ hg qpop test2.patch-2
458 $ hg qpop test2.patch-2
459 popping test1b.patch
459 popping test1b.patch
460 now at: test.patch
460 now at: test.patch
461 $ hg qpush test1b.patch+1
461 $ hg qpush test1b.patch+1
462 applying test1b.patch
462 applying test1b.patch
463 applying test2.patch
463 applying test2.patch
464 now at: test2.patch
464 now at: test2.patch
465
465
466
466
467 qpush --move
467 qpush --move
468
468
469 $ hg qpop -a
469 $ hg qpop -a
470 popping test2.patch
470 popping test2.patch
471 popping test1b.patch
471 popping test1b.patch
472 popping test.patch
472 popping test.patch
473 patch queue now empty
473 patch queue now empty
474 $ hg qguard test1b.patch -- -negguard
474 $ hg qguard test1b.patch -- -negguard
475 $ hg qguard test2.patch -- +posguard
475 $ hg qguard test2.patch -- +posguard
476 $ hg qpush --move test2.patch # can't move guarded patch
476 $ hg qpush --move test2.patch # can't move guarded patch
477 cannot push 'test2.patch' - guarded by '+posguard'
477 cannot push 'test2.patch' - guarded by '+posguard'
478 [1]
478 [1]
479 $ hg qselect posguard
479 $ hg qselect posguard
480 number of unguarded, unapplied patches has changed from 2 to 3
480 number of unguarded, unapplied patches has changed from 2 to 3
481 $ hg qpush --move test2.patch # move to front
481 $ hg qpush --move test2.patch # move to front
482 applying test2.patch
482 applying test2.patch
483 now at: test2.patch
483 now at: test2.patch
484 $ hg qpush --move test1b.patch # negative guard unselected
484 $ hg qpush --move test1b.patch # negative guard unselected
485 applying test1b.patch
485 applying test1b.patch
486 now at: test1b.patch
486 now at: test1b.patch
487 $ hg qpush --move test.patch # noop move
487 $ hg qpush --move test.patch # noop move
488 applying test.patch
488 applying test.patch
489 now at: test.patch
489 now at: test.patch
490 $ hg qseries -v
490 $ hg qseries -v
491 0 A test2.patch
491 0 A test2.patch
492 1 A test1b.patch
492 1 A test1b.patch
493 2 A test.patch
493 2 A test.patch
494 $ hg qpop -a
494 $ hg qpop -a
495 popping test.patch
495 popping test.patch
496 popping test1b.patch
496 popping test1b.patch
497 popping test2.patch
497 popping test2.patch
498 patch queue now empty
498 patch queue now empty
499
499
500 cleaning up
500 cleaning up
501
501
502 $ hg qselect --none
502 $ hg qselect --none
503 guards deactivated
503 guards deactivated
504 number of unguarded, unapplied patches has changed from 3 to 2
504 number of unguarded, unapplied patches has changed from 3 to 2
505 $ hg qguard --none test1b.patch
505 $ hg qguard --none test1b.patch
506 $ hg qguard --none test2.patch
506 $ hg qguard --none test2.patch
507 $ hg qpush --move test.patch
507 $ hg qpush --move test.patch
508 applying test.patch
508 applying test.patch
509 now at: test.patch
509 now at: test.patch
510 $ hg qpush --move test1b.patch
510 $ hg qpush --move test1b.patch
511 applying test1b.patch
511 applying test1b.patch
512 now at: test1b.patch
512 now at: test1b.patch
513 $ hg qpush --move bogus # nonexistent patch
513 $ hg qpush --move bogus # nonexistent patch
514 abort: patch bogus not in series
514 abort: patch bogus not in series
515 [255]
515 [255]
516 $ hg qpush --move # no patch
516 $ hg qpush --move # no patch
517 abort: please specify the patch to move
517 abort: please specify the patch to move
518 [255]
518 [255]
519 $ hg qpush --move test.patch # already applied
519 $ hg qpush --move test.patch # already applied
520 abort: cannot push to a previous patch: test.patch
520 abort: cannot push to a previous patch: test.patch
521 [255]
521 [255]
522 $ sed -i.bak '2i\# make qtip index different in series and fullseries' `hg root`/.hg/patches/series
522 $ sed '2i\
523 > # make qtip index different in series and fullseries
524 > ' `hg root`/.hg/patches/series > $TESTTMP/sedtmp
525 $ cp $TESTTMP/sedtmp `hg root`/.hg/patches/series
523 $ cat `hg root`/.hg/patches/series
526 $ cat `hg root`/.hg/patches/series
524 # comment
527 # comment
525 # make qtip index different in series and fullseries
528 # make qtip index different in series and fullseries
526
529
527 test.patch
530 test.patch
528 test1b.patch
531 test1b.patch
529 test2.patch
532 test2.patch
530 $ hg qpush --move test2.patch
533 $ hg qpush --move test2.patch
531 applying test2.patch
534 applying test2.patch
532 now at: test2.patch
535 now at: test2.patch
533
536
534
537
535 series after move
538 series after move
536
539
537 $ cat `hg root`/.hg/patches/series
540 $ cat `hg root`/.hg/patches/series
538 # comment
541 # comment
539 # make qtip index different in series and fullseries
542 # make qtip index different in series and fullseries
540
543
541 test.patch
544 test.patch
542 test1b.patch
545 test1b.patch
543 test2.patch
546 test2.patch
544
547
545
548
546 pop, qapplied, qunapplied
549 pop, qapplied, qunapplied
547
550
548 $ hg qseries -v
551 $ hg qseries -v
549 0 A test.patch
552 0 A test.patch
550 1 A test1b.patch
553 1 A test1b.patch
551 2 A test2.patch
554 2 A test2.patch
552
555
553 qapplied -1 test.patch
556 qapplied -1 test.patch
554
557
555 $ hg qapplied -1 test.patch
558 $ hg qapplied -1 test.patch
556 only one patch applied
559 only one patch applied
557 [1]
560 [1]
558
561
559 qapplied -1 test1b.patch
562 qapplied -1 test1b.patch
560
563
561 $ hg qapplied -1 test1b.patch
564 $ hg qapplied -1 test1b.patch
562 test.patch
565 test.patch
563
566
564 qapplied -1 test2.patch
567 qapplied -1 test2.patch
565
568
566 $ hg qapplied -1 test2.patch
569 $ hg qapplied -1 test2.patch
567 test1b.patch
570 test1b.patch
568
571
569 qapplied -1
572 qapplied -1
570
573
571 $ hg qapplied -1
574 $ hg qapplied -1
572 test1b.patch
575 test1b.patch
573
576
574 qapplied
577 qapplied
575
578
576 $ hg qapplied
579 $ hg qapplied
577 test.patch
580 test.patch
578 test1b.patch
581 test1b.patch
579 test2.patch
582 test2.patch
580
583
581 qapplied test1b.patch
584 qapplied test1b.patch
582
585
583 $ hg qapplied test1b.patch
586 $ hg qapplied test1b.patch
584 test.patch
587 test.patch
585 test1b.patch
588 test1b.patch
586
589
587 qunapplied -1
590 qunapplied -1
588
591
589 $ hg qunapplied -1
592 $ hg qunapplied -1
590 all patches applied
593 all patches applied
591 [1]
594 [1]
592
595
593 qunapplied
596 qunapplied
594
597
595 $ hg qunapplied
598 $ hg qunapplied
596
599
597 popping
600 popping
598
601
599 $ hg qpop
602 $ hg qpop
600 popping test2.patch
603 popping test2.patch
601 now at: test1b.patch
604 now at: test1b.patch
602
605
603 qunapplied -1
606 qunapplied -1
604
607
605 $ hg qunapplied -1
608 $ hg qunapplied -1
606 test2.patch
609 test2.patch
607
610
608 qunapplied
611 qunapplied
609
612
610 $ hg qunapplied
613 $ hg qunapplied
611 test2.patch
614 test2.patch
612
615
613 qunapplied test2.patch
616 qunapplied test2.patch
614
617
615 $ hg qunapplied test2.patch
618 $ hg qunapplied test2.patch
616
619
617 qunapplied -1 test2.patch
620 qunapplied -1 test2.patch
618
621
619 $ hg qunapplied -1 test2.patch
622 $ hg qunapplied -1 test2.patch
620 all patches applied
623 all patches applied
621 [1]
624 [1]
622
625
623 popping -a
626 popping -a
624
627
625 $ hg qpop -a
628 $ hg qpop -a
626 popping test1b.patch
629 popping test1b.patch
627 popping test.patch
630 popping test.patch
628 patch queue now empty
631 patch queue now empty
629
632
630 qapplied
633 qapplied
631
634
632 $ hg qapplied
635 $ hg qapplied
633
636
634 qapplied -1
637 qapplied -1
635
638
636 $ hg qapplied -1
639 $ hg qapplied -1
637 no patches applied
640 no patches applied
638 [1]
641 [1]
639 $ hg qpush
642 $ hg qpush
640 applying test.patch
643 applying test.patch
641 now at: test.patch
644 now at: test.patch
642
645
643
646
644 push should succeed
647 push should succeed
645
648
646 $ hg qpop -a
649 $ hg qpop -a
647 popping test.patch
650 popping test.patch
648 patch queue now empty
651 patch queue now empty
649 $ hg push ../../k
652 $ hg push ../../k
650 pushing to ../../k
653 pushing to ../../k
651 searching for changes
654 searching for changes
652 adding changesets
655 adding changesets
653 adding manifests
656 adding manifests
654 adding file changes
657 adding file changes
655 added 1 changesets with 1 changes to 1 files
658 added 1 changesets with 1 changes to 1 files
656
659
657
660
658 we want to start with some patches applied
661 we want to start with some patches applied
659
662
660 $ hg qpush -a
663 $ hg qpush -a
661 applying test.patch
664 applying test.patch
662 applying test1b.patch
665 applying test1b.patch
663 applying test2.patch
666 applying test2.patch
664 now at: test2.patch
667 now at: test2.patch
665
668
666 % pops all patches and succeeds
669 % pops all patches and succeeds
667
670
668 $ hg qpop -a
671 $ hg qpop -a
669 popping test2.patch
672 popping test2.patch
670 popping test1b.patch
673 popping test1b.patch
671 popping test.patch
674 popping test.patch
672 patch queue now empty
675 patch queue now empty
673
676
674 % does nothing and succeeds
677 % does nothing and succeeds
675
678
676 $ hg qpop -a
679 $ hg qpop -a
677 no patches applied
680 no patches applied
678
681
679 % fails - nothing else to pop
682 % fails - nothing else to pop
680
683
681 $ hg qpop
684 $ hg qpop
682 no patches applied
685 no patches applied
683 [1]
686 [1]
684
687
685 % pushes a patch and succeeds
688 % pushes a patch and succeeds
686
689
687 $ hg qpush
690 $ hg qpush
688 applying test.patch
691 applying test.patch
689 now at: test.patch
692 now at: test.patch
690
693
691 % pops a patch and succeeds
694 % pops a patch and succeeds
692
695
693 $ hg qpop
696 $ hg qpop
694 popping test.patch
697 popping test.patch
695 patch queue now empty
698 patch queue now empty
696
699
697 % pushes up to test1b.patch and succeeds
700 % pushes up to test1b.patch and succeeds
698
701
699 $ hg qpush test1b.patch
702 $ hg qpush test1b.patch
700 applying test.patch
703 applying test.patch
701 applying test1b.patch
704 applying test1b.patch
702 now at: test1b.patch
705 now at: test1b.patch
703
706
704 % does nothing and succeeds
707 % does nothing and succeeds
705
708
706 $ hg qpush test1b.patch
709 $ hg qpush test1b.patch
707 qpush: test1b.patch is already at the top
710 qpush: test1b.patch is already at the top
708
711
709 % does nothing and succeeds
712 % does nothing and succeeds
710
713
711 $ hg qpop test1b.patch
714 $ hg qpop test1b.patch
712 qpop: test1b.patch is already at the top
715 qpop: test1b.patch is already at the top
713
716
714 % fails - can't push to this patch
717 % fails - can't push to this patch
715
718
716 $ hg qpush test.patch
719 $ hg qpush test.patch
717 abort: cannot push to a previous patch: test.patch
720 abort: cannot push to a previous patch: test.patch
718 [255]
721 [255]
719
722
720 % fails - can't pop to this patch
723 % fails - can't pop to this patch
721
724
722 $ hg qpop test2.patch
725 $ hg qpop test2.patch
723 abort: patch test2.patch is not applied
726 abort: patch test2.patch is not applied
724 [255]
727 [255]
725
728
726 % pops up to test.patch and succeeds
729 % pops up to test.patch and succeeds
727
730
728 $ hg qpop test.patch
731 $ hg qpop test.patch
729 popping test1b.patch
732 popping test1b.patch
730 now at: test.patch
733 now at: test.patch
731
734
732 % pushes all patches and succeeds
735 % pushes all patches and succeeds
733
736
734 $ hg qpush -a
737 $ hg qpush -a
735 applying test1b.patch
738 applying test1b.patch
736 applying test2.patch
739 applying test2.patch
737 now at: test2.patch
740 now at: test2.patch
738
741
739 % does nothing and succeeds
742 % does nothing and succeeds
740
743
741 $ hg qpush -a
744 $ hg qpush -a
742 all patches are currently applied
745 all patches are currently applied
743
746
744 % fails - nothing else to push
747 % fails - nothing else to push
745
748
746 $ hg qpush
749 $ hg qpush
747 patch series already fully applied
750 patch series already fully applied
748 [1]
751 [1]
749
752
750 % does nothing and succeeds
753 % does nothing and succeeds
751
754
752 $ hg qpush test2.patch
755 $ hg qpush test2.patch
753 qpush: test2.patch is already at the top
756 qpush: test2.patch is already at the top
754
757
755 strip
758 strip
756
759
757 $ cd ../../b
760 $ cd ../../b
758 $ echo x>x
761 $ echo x>x
759 $ hg ci -Ama
762 $ hg ci -Ama
760 adding x
763 adding x
761 $ hg strip tip
764 $ hg strip tip
762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
765 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
763 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
766 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
764 $ hg unbundle .hg/strip-backup/*
767 $ hg unbundle .hg/strip-backup/*
765 adding changesets
768 adding changesets
766 adding manifests
769 adding manifests
767 adding file changes
770 adding file changes
768 added 1 changesets with 1 changes to 1 files
771 added 1 changesets with 1 changes to 1 files
769 (run 'hg update' to get a working copy)
772 (run 'hg update' to get a working copy)
770
773
771
774
772 strip with local changes, should complain
775 strip with local changes, should complain
773
776
774 $ hg up
777 $ hg up
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 $ echo y>y
779 $ echo y>y
777 $ hg add y
780 $ hg add y
778 $ hg strip tip
781 $ hg strip tip
779 abort: local changes found
782 abort: local changes found
780 [255]
783 [255]
781
784
782 --force strip with local changes
785 --force strip with local changes
783
786
784 $ hg strip -f tip
787 $ hg strip -f tip
785 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
788 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
786 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
789 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
787
790
788
791
789 cd b; hg qrefresh
792 cd b; hg qrefresh
790
793
791 $ hg init refresh
794 $ hg init refresh
792 $ cd refresh
795 $ cd refresh
793 $ echo a > a
796 $ echo a > a
794 $ hg ci -Ama
797 $ hg ci -Ama
795 adding a
798 adding a
796 $ hg qnew -mfoo foo
799 $ hg qnew -mfoo foo
797 $ echo a >> a
800 $ echo a >> a
798 $ hg qrefresh
801 $ hg qrefresh
799 $ mkdir b
802 $ mkdir b
800 $ cd b
803 $ cd b
801 $ echo f > f
804 $ echo f > f
802 $ hg add f
805 $ hg add f
803 $ hg qrefresh
806 $ hg qrefresh
804 $ cat ../.hg/patches/foo
807 $ cat ../.hg/patches/foo
805 foo
808 foo
806
809
807 diff -r cb9a9f314b8b a
810 diff -r cb9a9f314b8b a
808 --- a/a\t(?P<date>.*) (re)
811 --- a/a\t(?P<date>.*) (re)
809 \+\+\+ b/a\t(?P<date>.*) (re)
812 \+\+\+ b/a\t(?P<date>.*) (re)
810 @@ -1,1 +1,2 @@
813 @@ -1,1 +1,2 @@
811 a
814 a
812 +a
815 +a
813 diff -r cb9a9f314b8b b/f
816 diff -r cb9a9f314b8b b/f
814 --- /dev/null\t(?P<date>.*) (re)
817 --- /dev/null\t(?P<date>.*) (re)
815 \+\+\+ b/b/f\t(?P<date>.*) (re)
818 \+\+\+ b/b/f\t(?P<date>.*) (re)
816 @@ -0,0 +1,1 @@
819 @@ -0,0 +1,1 @@
817 +f
820 +f
818
821
819 hg qrefresh .
822 hg qrefresh .
820
823
821 $ hg qrefresh .
824 $ hg qrefresh .
822 $ cat ../.hg/patches/foo
825 $ cat ../.hg/patches/foo
823 foo
826 foo
824
827
825 diff -r cb9a9f314b8b b/f
828 diff -r cb9a9f314b8b b/f
826 --- /dev/null\t(?P<date>.*) (re)
829 --- /dev/null\t(?P<date>.*) (re)
827 \+\+\+ b/b/f\t(?P<date>.*) (re)
830 \+\+\+ b/b/f\t(?P<date>.*) (re)
828 @@ -0,0 +1,1 @@
831 @@ -0,0 +1,1 @@
829 +f
832 +f
830 $ hg status
833 $ hg status
831 M a
834 M a
832
835
833
836
834 qpush failure
837 qpush failure
835
838
836 $ cd ..
839 $ cd ..
837 $ hg qrefresh
840 $ hg qrefresh
838 $ hg qnew -mbar bar
841 $ hg qnew -mbar bar
839 $ echo foo > foo
842 $ echo foo > foo
840 $ echo bar > bar
843 $ echo bar > bar
841 $ hg add foo bar
844 $ hg add foo bar
842 $ hg qrefresh
845 $ hg qrefresh
843 $ hg qpop -a
846 $ hg qpop -a
844 popping bar
847 popping bar
845 popping foo
848 popping foo
846 patch queue now empty
849 patch queue now empty
847 $ echo bar > foo
850 $ echo bar > foo
848 $ hg qpush -a
851 $ hg qpush -a
849 applying foo
852 applying foo
850 applying bar
853 applying bar
851 file foo already exists
854 file foo already exists
852 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
855 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
853 patch failed, unable to continue (try -v)
856 patch failed, unable to continue (try -v)
854 patch failed, rejects left in working dir
857 patch failed, rejects left in working dir
855 errors during apply, please fix and refresh bar
858 errors during apply, please fix and refresh bar
856 [2]
859 [2]
857 $ hg st
860 $ hg st
858 ? foo
861 ? foo
859 ? foo.rej
862 ? foo.rej
860
863
861
864
862 mq tags
865 mq tags
863
866
864 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
867 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
865 0 qparent
868 0 qparent
866 1 foo qbase
869 1 foo qbase
867 2 bar qtip tip
870 2 bar qtip tip
868
871
869 mq revset
872 mq revset
870
873
871 $ hg log -r 'mq()' --template '{rev}\n'
874 $ hg log -r 'mq()' --template '{rev}\n'
872 1
875 1
873 2
876 2
874 $ hg help revsets | grep -i mq
877 $ hg help revsets | grep -i mq
875 "mq()"
878 "mq()"
876 Changesets managed by MQ.
879 Changesets managed by MQ.
877
880
878 bad node in status
881 bad node in status
879
882
880 $ hg qpop
883 $ hg qpop
881 popping bar
884 popping bar
882 now at: foo
885 now at: foo
883 $ hg strip -qn tip
886 $ hg strip -qn tip
884 $ hg tip
887 $ hg tip
885 changeset: 0:cb9a9f314b8b
888 changeset: 0:cb9a9f314b8b
886 tag: tip
889 tag: tip
887 user: test
890 user: test
888 date: Thu Jan 01 00:00:00 1970 +0000
891 date: Thu Jan 01 00:00:00 1970 +0000
889 summary: a
892 summary: a
890
893
891 $ hg branches
894 $ hg branches
892 default 0:cb9a9f314b8b
895 default 0:cb9a9f314b8b
893 $ hg qpop
896 $ hg qpop
894 no patches applied
897 no patches applied
895 [1]
898 [1]
896
899
897 $ cat >>$HGRCPATH <<EOF
900 $ cat >>$HGRCPATH <<EOF
898 > [diff]
901 > [diff]
899 > git = True
902 > git = True
900 > EOF
903 > EOF
901 $ cd ..
904 $ cd ..
902 $ hg init git
905 $ hg init git
903 $ cd git
906 $ cd git
904 $ hg qinit
907 $ hg qinit
905
908
906 $ hg qnew -m'new file' new
909 $ hg qnew -m'new file' new
907 $ echo foo > new
910 $ echo foo > new
908 $ chmod +x new
911 $ chmod +x new
909 $ hg add new
912 $ hg add new
910 $ hg qrefresh
913 $ hg qrefresh
911 $ cat .hg/patches/new
914 $ cat .hg/patches/new
912 new file
915 new file
913
916
914 diff --git a/new b/new
917 diff --git a/new b/new
915 new file mode 100755
918 new file mode 100755
916 --- /dev/null
919 --- /dev/null
917 +++ b/new
920 +++ b/new
918 @@ -0,0 +1,1 @@
921 @@ -0,0 +1,1 @@
919 +foo
922 +foo
920
923
921 $ hg qnew -m'copy file' copy
924 $ hg qnew -m'copy file' copy
922 $ hg cp new copy
925 $ hg cp new copy
923 $ hg qrefresh
926 $ hg qrefresh
924 $ cat .hg/patches/copy
927 $ cat .hg/patches/copy
925 copy file
928 copy file
926
929
927 diff --git a/new b/copy
930 diff --git a/new b/copy
928 copy from new
931 copy from new
929 copy to copy
932 copy to copy
930
933
931 $ hg qpop
934 $ hg qpop
932 popping copy
935 popping copy
933 now at: new
936 now at: new
934 $ hg qpush
937 $ hg qpush
935 applying copy
938 applying copy
936 now at: copy
939 now at: copy
937 $ hg qdiff
940 $ hg qdiff
938 diff --git a/new b/copy
941 diff --git a/new b/copy
939 copy from new
942 copy from new
940 copy to copy
943 copy to copy
941 $ cat >>$HGRCPATH <<EOF
944 $ cat >>$HGRCPATH <<EOF
942 > [diff]
945 > [diff]
943 > git = False
946 > git = False
944 > EOF
947 > EOF
945 $ hg qdiff --git
948 $ hg qdiff --git
946 diff --git a/new b/copy
949 diff --git a/new b/copy
947 copy from new
950 copy from new
948 copy to copy
951 copy to copy
949 $ cd ..
952 $ cd ..
950
953
951 empty lines in status
954 empty lines in status
952
955
953 $ hg init emptystatus
956 $ hg init emptystatus
954 $ cd emptystatus
957 $ cd emptystatus
955 $ hg qinit
958 $ hg qinit
956 $ printf '\n\n' > .hg/patches/status
959 $ printf '\n\n' > .hg/patches/status
957 $ hg qser
960 $ hg qser
958 $ cd ..
961 $ cd ..
959
962
960 bad line in status (without ":")
963 bad line in status (without ":")
961
964
962 $ hg init badstatus
965 $ hg init badstatus
963 $ cd badstatus
966 $ cd badstatus
964 $ hg qinit
967 $ hg qinit
965 $ printf 'babar has no colon in this line\n' > .hg/patches/status
968 $ printf 'babar has no colon in this line\n' > .hg/patches/status
966 $ hg qser
969 $ hg qser
967 malformated mq status line: ['babar has no colon in this line']
970 malformated mq status line: ['babar has no colon in this line']
968 $ cd ..
971 $ cd ..
969
972
970
973
971 test file addition in slow path
974 test file addition in slow path
972
975
973 $ hg init slow
976 $ hg init slow
974 $ cd slow
977 $ cd slow
975 $ hg qinit
978 $ hg qinit
976 $ echo foo > foo
979 $ echo foo > foo
977 $ hg add foo
980 $ hg add foo
978 $ hg ci -m 'add foo'
981 $ hg ci -m 'add foo'
979 $ hg qnew bar
982 $ hg qnew bar
980 $ echo bar > bar
983 $ echo bar > bar
981 $ hg add bar
984 $ hg add bar
982 $ hg mv foo baz
985 $ hg mv foo baz
983 $ hg qrefresh --git
986 $ hg qrefresh --git
984 $ hg up -C 0
987 $ hg up -C 0
985 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
988 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
986 $ echo >> foo
989 $ echo >> foo
987 $ hg ci -m 'change foo'
990 $ hg ci -m 'change foo'
988 created new head
991 created new head
989 $ hg up -C 1
992 $ hg up -C 1
990 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
993 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
991 $ hg qrefresh --git
994 $ hg qrefresh --git
992 $ cat .hg/patches/bar
995 $ cat .hg/patches/bar
993 diff --git a/bar b/bar
996 diff --git a/bar b/bar
994 new file mode 100644
997 new file mode 100644
995 --- /dev/null
998 --- /dev/null
996 +++ b/bar
999 +++ b/bar
997 @@ -0,0 +1,1 @@
1000 @@ -0,0 +1,1 @@
998 +bar
1001 +bar
999 diff --git a/foo b/baz
1002 diff --git a/foo b/baz
1000 rename from foo
1003 rename from foo
1001 rename to baz
1004 rename to baz
1002 $ hg log -v --template '{rev} {file_copies}\n' -r .
1005 $ hg log -v --template '{rev} {file_copies}\n' -r .
1003 2 baz (foo)
1006 2 baz (foo)
1004 $ hg qrefresh --git
1007 $ hg qrefresh --git
1005 $ cat .hg/patches/bar
1008 $ cat .hg/patches/bar
1006 diff --git a/bar b/bar
1009 diff --git a/bar b/bar
1007 new file mode 100644
1010 new file mode 100644
1008 --- /dev/null
1011 --- /dev/null
1009 +++ b/bar
1012 +++ b/bar
1010 @@ -0,0 +1,1 @@
1013 @@ -0,0 +1,1 @@
1011 +bar
1014 +bar
1012 diff --git a/foo b/baz
1015 diff --git a/foo b/baz
1013 rename from foo
1016 rename from foo
1014 rename to baz
1017 rename to baz
1015 $ hg log -v --template '{rev} {file_copies}\n' -r .
1018 $ hg log -v --template '{rev} {file_copies}\n' -r .
1016 2 baz (foo)
1019 2 baz (foo)
1017 $ hg qrefresh
1020 $ hg qrefresh
1018 $ grep 'diff --git' .hg/patches/bar
1021 $ grep 'diff --git' .hg/patches/bar
1019 diff --git a/bar b/bar
1022 diff --git a/bar b/bar
1020 diff --git a/foo b/baz
1023 diff --git a/foo b/baz
1021
1024
1022
1025
1023 test file move chains in the slow path
1026 test file move chains in the slow path
1024
1027
1025 $ hg up -C 1
1028 $ hg up -C 1
1026 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1029 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1027 $ echo >> foo
1030 $ echo >> foo
1028 $ hg ci -m 'change foo again'
1031 $ hg ci -m 'change foo again'
1029 $ hg up -C 2
1032 $ hg up -C 2
1030 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1033 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1031 $ hg mv bar quux
1034 $ hg mv bar quux
1032 $ hg mv baz bleh
1035 $ hg mv baz bleh
1033 $ hg qrefresh --git
1036 $ hg qrefresh --git
1034 $ cat .hg/patches/bar
1037 $ cat .hg/patches/bar
1035 diff --git a/foo b/bleh
1038 diff --git a/foo b/bleh
1036 rename from foo
1039 rename from foo
1037 rename to bleh
1040 rename to bleh
1038 diff --git a/quux b/quux
1041 diff --git a/quux b/quux
1039 new file mode 100644
1042 new file mode 100644
1040 --- /dev/null
1043 --- /dev/null
1041 +++ b/quux
1044 +++ b/quux
1042 @@ -0,0 +1,1 @@
1045 @@ -0,0 +1,1 @@
1043 +bar
1046 +bar
1044 $ hg log -v --template '{rev} {file_copies}\n' -r .
1047 $ hg log -v --template '{rev} {file_copies}\n' -r .
1045 3 bleh (foo)
1048 3 bleh (foo)
1046 $ hg mv quux fred
1049 $ hg mv quux fred
1047 $ hg mv bleh barney
1050 $ hg mv bleh barney
1048 $ hg qrefresh --git
1051 $ hg qrefresh --git
1049 $ cat .hg/patches/bar
1052 $ cat .hg/patches/bar
1050 diff --git a/foo b/barney
1053 diff --git a/foo b/barney
1051 rename from foo
1054 rename from foo
1052 rename to barney
1055 rename to barney
1053 diff --git a/fred b/fred
1056 diff --git a/fred b/fred
1054 new file mode 100644
1057 new file mode 100644
1055 --- /dev/null
1058 --- /dev/null
1056 +++ b/fred
1059 +++ b/fred
1057 @@ -0,0 +1,1 @@
1060 @@ -0,0 +1,1 @@
1058 +bar
1061 +bar
1059 $ hg log -v --template '{rev} {file_copies}\n' -r .
1062 $ hg log -v --template '{rev} {file_copies}\n' -r .
1060 3 barney (foo)
1063 3 barney (foo)
1061
1064
1062
1065
1063 refresh omitting an added file
1066 refresh omitting an added file
1064
1067
1065 $ hg qnew baz
1068 $ hg qnew baz
1066 $ echo newfile > newfile
1069 $ echo newfile > newfile
1067 $ hg add newfile
1070 $ hg add newfile
1068 $ hg qrefresh
1071 $ hg qrefresh
1069 $ hg st -A newfile
1072 $ hg st -A newfile
1070 C newfile
1073 C newfile
1071 $ hg qrefresh -X newfile
1074 $ hg qrefresh -X newfile
1072 $ hg st -A newfile
1075 $ hg st -A newfile
1073 A newfile
1076 A newfile
1074 $ hg revert newfile
1077 $ hg revert newfile
1075 $ rm newfile
1078 $ rm newfile
1076 $ hg qpop
1079 $ hg qpop
1077 popping baz
1080 popping baz
1078 now at: bar
1081 now at: bar
1079 $ hg qdel baz
1082 $ hg qdel baz
1080
1083
1081
1084
1082 create a git patch
1085 create a git patch
1083
1086
1084 $ echo a > alexander
1087 $ echo a > alexander
1085 $ hg add alexander
1088 $ hg add alexander
1086 $ hg qnew -f --git addalexander
1089 $ hg qnew -f --git addalexander
1087 $ grep diff .hg/patches/addalexander
1090 $ grep diff .hg/patches/addalexander
1088 diff --git a/alexander b/alexander
1091 diff --git a/alexander b/alexander
1089
1092
1090
1093
1091 create a git binary patch
1094 create a git binary patch
1092
1095
1093 $ cat > writebin.py <<EOF
1096 $ cat > writebin.py <<EOF
1094 > import sys
1097 > import sys
1095 > path = sys.argv[1]
1098 > path = sys.argv[1]
1096 > open(path, 'wb').write('BIN\x00ARY')
1099 > open(path, 'wb').write('BIN\x00ARY')
1097 > EOF
1100 > EOF
1098 $ python writebin.py bucephalus
1101 $ python writebin.py bucephalus
1099
1102
1100 $ python "$TESTDIR/md5sum.py" bucephalus
1103 $ python "$TESTDIR/md5sum.py" bucephalus
1101 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1104 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1102 $ hg add bucephalus
1105 $ hg add bucephalus
1103 $ hg qnew -f --git addbucephalus
1106 $ hg qnew -f --git addbucephalus
1104 $ grep diff .hg/patches/addbucephalus
1107 $ grep diff .hg/patches/addbucephalus
1105 diff --git a/bucephalus b/bucephalus
1108 diff --git a/bucephalus b/bucephalus
1106
1109
1107
1110
1108 check binary patches can be popped and pushed
1111 check binary patches can be popped and pushed
1109
1112
1110 $ hg qpop
1113 $ hg qpop
1111 popping addbucephalus
1114 popping addbucephalus
1112 now at: addalexander
1115 now at: addalexander
1113 $ test -f bucephalus && echo % bucephalus should not be there
1116 $ test -f bucephalus && echo % bucephalus should not be there
1114 [1]
1117 [1]
1115 $ hg qpush
1118 $ hg qpush
1116 applying addbucephalus
1119 applying addbucephalus
1117 now at: addbucephalus
1120 now at: addbucephalus
1118 $ test -f bucephalus
1121 $ test -f bucephalus
1119 $ python "$TESTDIR/md5sum.py" bucephalus
1122 $ python "$TESTDIR/md5sum.py" bucephalus
1120 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1123 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1121
1124
1122
1125
1123
1126
1124 strip again
1127 strip again
1125
1128
1126 $ cd ..
1129 $ cd ..
1127 $ hg init strip
1130 $ hg init strip
1128 $ cd strip
1131 $ cd strip
1129 $ touch foo
1132 $ touch foo
1130 $ hg add foo
1133 $ hg add foo
1131 $ hg ci -m 'add foo'
1134 $ hg ci -m 'add foo'
1132 $ echo >> foo
1135 $ echo >> foo
1133 $ hg ci -m 'change foo 1'
1136 $ hg ci -m 'change foo 1'
1134 $ hg up -C 0
1137 $ hg up -C 0
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1138 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 $ echo 1 >> foo
1139 $ echo 1 >> foo
1137 $ hg ci -m 'change foo 2'
1140 $ hg ci -m 'change foo 2'
1138 created new head
1141 created new head
1139 $ HGMERGE=true hg merge
1142 $ HGMERGE=true hg merge
1140 merging foo
1143 merging foo
1141 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1144 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1142 (branch merge, don't forget to commit)
1145 (branch merge, don't forget to commit)
1143 $ hg ci -m merge
1146 $ hg ci -m merge
1144 $ hg log
1147 $ hg log
1145 changeset: 3:99615015637b
1148 changeset: 3:99615015637b
1146 tag: tip
1149 tag: tip
1147 parent: 2:20cbbe65cff7
1150 parent: 2:20cbbe65cff7
1148 parent: 1:d2871fc282d4
1151 parent: 1:d2871fc282d4
1149 user: test
1152 user: test
1150 date: Thu Jan 01 00:00:00 1970 +0000
1153 date: Thu Jan 01 00:00:00 1970 +0000
1151 summary: merge
1154 summary: merge
1152
1155
1153 changeset: 2:20cbbe65cff7
1156 changeset: 2:20cbbe65cff7
1154 parent: 0:53245c60e682
1157 parent: 0:53245c60e682
1155 user: test
1158 user: test
1156 date: Thu Jan 01 00:00:00 1970 +0000
1159 date: Thu Jan 01 00:00:00 1970 +0000
1157 summary: change foo 2
1160 summary: change foo 2
1158
1161
1159 changeset: 1:d2871fc282d4
1162 changeset: 1:d2871fc282d4
1160 user: test
1163 user: test
1161 date: Thu Jan 01 00:00:00 1970 +0000
1164 date: Thu Jan 01 00:00:00 1970 +0000
1162 summary: change foo 1
1165 summary: change foo 1
1163
1166
1164 changeset: 0:53245c60e682
1167 changeset: 0:53245c60e682
1165 user: test
1168 user: test
1166 date: Thu Jan 01 00:00:00 1970 +0000
1169 date: Thu Jan 01 00:00:00 1970 +0000
1167 summary: add foo
1170 summary: add foo
1168
1171
1169 $ hg strip 1
1172 $ hg strip 1
1170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1174 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1172 $ checkundo strip
1175 $ checkundo strip
1173 $ hg log
1176 $ hg log
1174 changeset: 1:20cbbe65cff7
1177 changeset: 1:20cbbe65cff7
1175 tag: tip
1178 tag: tip
1176 user: test
1179 user: test
1177 date: Thu Jan 01 00:00:00 1970 +0000
1180 date: Thu Jan 01 00:00:00 1970 +0000
1178 summary: change foo 2
1181 summary: change foo 2
1179
1182
1180 changeset: 0:53245c60e682
1183 changeset: 0:53245c60e682
1181 user: test
1184 user: test
1182 date: Thu Jan 01 00:00:00 1970 +0000
1185 date: Thu Jan 01 00:00:00 1970 +0000
1183 summary: add foo
1186 summary: add foo
1184
1187
1185 $ cd ..
1188 $ cd ..
1186
1189
1187
1190
1188 qclone
1191 qclone
1189
1192
1190 $ qlog()
1193 $ qlog()
1191 > {
1194 > {
1192 > echo 'main repo:'
1195 > echo 'main repo:'
1193 > hg log --template ' rev {rev}: {desc}\n'
1196 > hg log --template ' rev {rev}: {desc}\n'
1194 > echo 'patch repo:'
1197 > echo 'patch repo:'
1195 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1198 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1196 > }
1199 > }
1197 $ hg init qclonesource
1200 $ hg init qclonesource
1198 $ cd qclonesource
1201 $ cd qclonesource
1199 $ echo foo > foo
1202 $ echo foo > foo
1200 $ hg add foo
1203 $ hg add foo
1201 $ hg ci -m 'add foo'
1204 $ hg ci -m 'add foo'
1202 $ hg qinit
1205 $ hg qinit
1203 $ hg qnew patch1
1206 $ hg qnew patch1
1204 $ echo bar >> foo
1207 $ echo bar >> foo
1205 $ hg qrefresh -m 'change foo'
1208 $ hg qrefresh -m 'change foo'
1206 $ cd ..
1209 $ cd ..
1207
1210
1208
1211
1209 repo with unversioned patch dir
1212 repo with unversioned patch dir
1210
1213
1211 $ hg qclone qclonesource failure
1214 $ hg qclone qclonesource failure
1212 abort: versioned patch repository not found (see init --mq)
1215 abort: versioned patch repository not found (see init --mq)
1213 [255]
1216 [255]
1214
1217
1215 $ cd qclonesource
1218 $ cd qclonesource
1216 $ hg qinit -c
1219 $ hg qinit -c
1217 adding .hg/patches/patch1 (glob)
1220 adding .hg/patches/patch1 (glob)
1218 $ hg qci -m checkpoint
1221 $ hg qci -m checkpoint
1219 $ qlog
1222 $ qlog
1220 main repo:
1223 main repo:
1221 rev 1: change foo
1224 rev 1: change foo
1222 rev 0: add foo
1225 rev 0: add foo
1223 patch repo:
1226 patch repo:
1224 rev 0: checkpoint
1227 rev 0: checkpoint
1225 $ cd ..
1228 $ cd ..
1226
1229
1227
1230
1228 repo with patches applied
1231 repo with patches applied
1229
1232
1230 $ hg qclone qclonesource qclonedest
1233 $ hg qclone qclonesource qclonedest
1231 updating to branch default
1234 updating to branch default
1232 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1235 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1234 $ cd qclonedest
1237 $ cd qclonedest
1235 $ qlog
1238 $ qlog
1236 main repo:
1239 main repo:
1237 rev 0: add foo
1240 rev 0: add foo
1238 patch repo:
1241 patch repo:
1239 rev 0: checkpoint
1242 rev 0: checkpoint
1240 $ cd ..
1243 $ cd ..
1241
1244
1242
1245
1243 repo with patches unapplied
1246 repo with patches unapplied
1244
1247
1245 $ cd qclonesource
1248 $ cd qclonesource
1246 $ hg qpop -a
1249 $ hg qpop -a
1247 popping patch1
1250 popping patch1
1248 patch queue now empty
1251 patch queue now empty
1249 $ qlog
1252 $ qlog
1250 main repo:
1253 main repo:
1251 rev 0: add foo
1254 rev 0: add foo
1252 patch repo:
1255 patch repo:
1253 rev 0: checkpoint
1256 rev 0: checkpoint
1254 $ cd ..
1257 $ cd ..
1255 $ hg qclone qclonesource qclonedest2
1258 $ hg qclone qclonesource qclonedest2
1256 updating to branch default
1259 updating to branch default
1257 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1261 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 $ cd qclonedest2
1262 $ cd qclonedest2
1260 $ qlog
1263 $ qlog
1261 main repo:
1264 main repo:
1262 rev 0: add foo
1265 rev 0: add foo
1263 patch repo:
1266 patch repo:
1264 rev 0: checkpoint
1267 rev 0: checkpoint
1265 $ cd ..
1268 $ cd ..
1266
1269
1267
1270
1268 Issue1033: test applying on an empty file
1271 Issue1033: test applying on an empty file
1269
1272
1270 $ hg init empty
1273 $ hg init empty
1271 $ cd empty
1274 $ cd empty
1272 $ touch a
1275 $ touch a
1273 $ hg ci -Am addempty
1276 $ hg ci -Am addempty
1274 adding a
1277 adding a
1275 $ echo a > a
1278 $ echo a > a
1276 $ hg qnew -f -e changea
1279 $ hg qnew -f -e changea
1277 $ hg qpop
1280 $ hg qpop
1278 popping changea
1281 popping changea
1279 patch queue now empty
1282 patch queue now empty
1280 $ hg qpush
1283 $ hg qpush
1281 applying changea
1284 applying changea
1282 now at: changea
1285 now at: changea
1283 $ cd ..
1286 $ cd ..
1284
1287
1285 test qpush with --force, issue1087
1288 test qpush with --force, issue1087
1286
1289
1287 $ hg init forcepush
1290 $ hg init forcepush
1288 $ cd forcepush
1291 $ cd forcepush
1289 $ echo hello > hello.txt
1292 $ echo hello > hello.txt
1290 $ echo bye > bye.txt
1293 $ echo bye > bye.txt
1291 $ hg ci -Ama
1294 $ hg ci -Ama
1292 adding bye.txt
1295 adding bye.txt
1293 adding hello.txt
1296 adding hello.txt
1294 $ hg qnew -d '0 0' empty
1297 $ hg qnew -d '0 0' empty
1295 $ hg qpop
1298 $ hg qpop
1296 popping empty
1299 popping empty
1297 patch queue now empty
1300 patch queue now empty
1298 $ echo world >> hello.txt
1301 $ echo world >> hello.txt
1299
1302
1300
1303
1301 qpush should fail, local changes
1304 qpush should fail, local changes
1302
1305
1303 $ hg qpush
1306 $ hg qpush
1304 abort: local changes found
1307 abort: local changes found
1305 [255]
1308 [255]
1306
1309
1307
1310
1308 apply force, should not discard changes with empty patch
1311 apply force, should not discard changes with empty patch
1309
1312
1310 $ hg qpush -f
1313 $ hg qpush -f
1311 applying empty
1314 applying empty
1312 patch empty is empty
1315 patch empty is empty
1313 now at: empty
1316 now at: empty
1314 $ hg diff --config diff.nodates=True
1317 $ hg diff --config diff.nodates=True
1315 diff -r d58265112590 hello.txt
1318 diff -r d58265112590 hello.txt
1316 --- a/hello.txt
1319 --- a/hello.txt
1317 +++ b/hello.txt
1320 +++ b/hello.txt
1318 @@ -1,1 +1,2 @@
1321 @@ -1,1 +1,2 @@
1319 hello
1322 hello
1320 +world
1323 +world
1321 $ hg qdiff --config diff.nodates=True
1324 $ hg qdiff --config diff.nodates=True
1322 diff -r 9ecee4f634e3 hello.txt
1325 diff -r 9ecee4f634e3 hello.txt
1323 --- a/hello.txt
1326 --- a/hello.txt
1324 +++ b/hello.txt
1327 +++ b/hello.txt
1325 @@ -1,1 +1,2 @@
1328 @@ -1,1 +1,2 @@
1326 hello
1329 hello
1327 +world
1330 +world
1328 $ hg log -l1 -p
1331 $ hg log -l1 -p
1329 changeset: 1:d58265112590
1332 changeset: 1:d58265112590
1330 tag: empty
1333 tag: empty
1331 tag: qbase
1334 tag: qbase
1332 tag: qtip
1335 tag: qtip
1333 tag: tip
1336 tag: tip
1334 user: test
1337 user: test
1335 date: Thu Jan 01 00:00:00 1970 +0000
1338 date: Thu Jan 01 00:00:00 1970 +0000
1336 summary: imported patch empty
1339 summary: imported patch empty
1337
1340
1338
1341
1339 $ hg qref -d '0 0'
1342 $ hg qref -d '0 0'
1340 $ hg qpop
1343 $ hg qpop
1341 popping empty
1344 popping empty
1342 patch queue now empty
1345 patch queue now empty
1343 $ echo universe >> hello.txt
1346 $ echo universe >> hello.txt
1344 $ echo universe >> bye.txt
1347 $ echo universe >> bye.txt
1345
1348
1346
1349
1347 qpush should fail, local changes
1350 qpush should fail, local changes
1348
1351
1349 $ hg qpush
1352 $ hg qpush
1350 abort: local changes found
1353 abort: local changes found
1351 [255]
1354 [255]
1352
1355
1353
1356
1354 apply force, should discard changes in hello, but not bye
1357 apply force, should discard changes in hello, but not bye
1355
1358
1356 $ hg qpush -f
1359 $ hg qpush -f
1357 applying empty
1360 applying empty
1358 now at: empty
1361 now at: empty
1359 $ hg st
1362 $ hg st
1360 M bye.txt
1363 M bye.txt
1361 $ hg diff --config diff.nodates=True
1364 $ hg diff --config diff.nodates=True
1362 diff -r ba252371dbc1 bye.txt
1365 diff -r ba252371dbc1 bye.txt
1363 --- a/bye.txt
1366 --- a/bye.txt
1364 +++ b/bye.txt
1367 +++ b/bye.txt
1365 @@ -1,1 +1,2 @@
1368 @@ -1,1 +1,2 @@
1366 bye
1369 bye
1367 +universe
1370 +universe
1368 $ hg qdiff --config diff.nodates=True
1371 $ hg qdiff --config diff.nodates=True
1369 diff -r 9ecee4f634e3 bye.txt
1372 diff -r 9ecee4f634e3 bye.txt
1370 --- a/bye.txt
1373 --- a/bye.txt
1371 +++ b/bye.txt
1374 +++ b/bye.txt
1372 @@ -1,1 +1,2 @@
1375 @@ -1,1 +1,2 @@
1373 bye
1376 bye
1374 +universe
1377 +universe
1375 diff -r 9ecee4f634e3 hello.txt
1378 diff -r 9ecee4f634e3 hello.txt
1376 --- a/hello.txt
1379 --- a/hello.txt
1377 +++ b/hello.txt
1380 +++ b/hello.txt
1378 @@ -1,1 +1,3 @@
1381 @@ -1,1 +1,3 @@
1379 hello
1382 hello
1380 +world
1383 +world
1381 +universe
1384 +universe
1382
1385
1383
1386
1384 test popping revisions not in working dir ancestry
1387 test popping revisions not in working dir ancestry
1385
1388
1386 $ hg qseries -v
1389 $ hg qseries -v
1387 0 A empty
1390 0 A empty
1388 $ hg up qparent
1391 $ hg up qparent
1389 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1390 $ hg qpop
1393 $ hg qpop
1391 popping empty
1394 popping empty
1392 patch queue now empty
1395 patch queue now empty
1393
1396
1394 $ cd ..
1397 $ cd ..
1395 $ hg init deletion-order
1398 $ hg init deletion-order
1396 $ cd deletion-order
1399 $ cd deletion-order
1397
1400
1398 $ touch a
1401 $ touch a
1399 $ hg ci -Aqm0
1402 $ hg ci -Aqm0
1400
1403
1401 $ hg qnew rename-dir
1404 $ hg qnew rename-dir
1402 $ hg rm a
1405 $ hg rm a
1403 $ hg qrefresh
1406 $ hg qrefresh
1404
1407
1405 $ mkdir a b
1408 $ mkdir a b
1406 $ touch a/a b/b
1409 $ touch a/a b/b
1407 $ hg add -q a b
1410 $ hg add -q a b
1408 $ hg qrefresh
1411 $ hg qrefresh
1409
1412
1410
1413
1411 test popping must remove files added in subdirectories first
1414 test popping must remove files added in subdirectories first
1412
1415
1413 $ hg qpop
1416 $ hg qpop
1414 popping rename-dir
1417 popping rename-dir
1415 patch queue now empty
1418 patch queue now empty
1416 $ cd ..
1419 $ cd ..
1417
1420
1418
1421
1419 test case preservation through patch pushing especially on case
1422 test case preservation through patch pushing especially on case
1420 insensitive filesystem
1423 insensitive filesystem
1421
1424
1422 $ hg init casepreserve
1425 $ hg init casepreserve
1423 $ cd casepreserve
1426 $ cd casepreserve
1424
1427
1425 $ hg qnew add-file1
1428 $ hg qnew add-file1
1426 $ echo a > TeXtFiLe.TxT
1429 $ echo a > TeXtFiLe.TxT
1427 $ hg add TeXtFiLe.TxT
1430 $ hg add TeXtFiLe.TxT
1428 $ hg qrefresh
1431 $ hg qrefresh
1429
1432
1430 $ hg qnew add-file2
1433 $ hg qnew add-file2
1431 $ echo b > AnOtHeRFiLe.TxT
1434 $ echo b > AnOtHeRFiLe.TxT
1432 $ hg add AnOtHeRFiLe.TxT
1435 $ hg add AnOtHeRFiLe.TxT
1433 $ hg qrefresh
1436 $ hg qrefresh
1434
1437
1435 $ hg qnew modify-file
1438 $ hg qnew modify-file
1436 $ echo c >> AnOtHeRFiLe.TxT
1439 $ echo c >> AnOtHeRFiLe.TxT
1437 $ hg qrefresh
1440 $ hg qrefresh
1438
1441
1439 $ hg qapplied
1442 $ hg qapplied
1440 add-file1
1443 add-file1
1441 add-file2
1444 add-file2
1442 modify-file
1445 modify-file
1443 $ hg qpop -a
1446 $ hg qpop -a
1444 popping modify-file
1447 popping modify-file
1445 popping add-file2
1448 popping add-file2
1446 popping add-file1
1449 popping add-file1
1447 patch queue now empty
1450 patch queue now empty
1448
1451
1449 this qpush causes problems below, if case preservation on case
1452 this qpush causes problems below, if case preservation on case
1450 insensitive filesystem is not enough:
1453 insensitive filesystem is not enough:
1451 (1) unexpected "adding ..." messages are shown
1454 (1) unexpected "adding ..." messages are shown
1452 (2) patching fails in modification of (1) files
1455 (2) patching fails in modification of (1) files
1453
1456
1454 $ hg qpush -a
1457 $ hg qpush -a
1455 applying add-file1
1458 applying add-file1
1456 applying add-file2
1459 applying add-file2
1457 applying modify-file
1460 applying modify-file
1458 now at: modify-file
1461 now at: modify-file
1459
1462
1460 Proper phase default with mq:
1463 Proper phase default with mq:
1461
1464
1462 1. mq.secret=false
1465 1. mq.secret=false
1463
1466
1464 $ rm .hg/store/phaseroots
1467 $ rm .hg/store/phaseroots
1465 $ hg phase 'qparent::'
1468 $ hg phase 'qparent::'
1466 0: draft
1469 0: draft
1467 1: draft
1470 1: draft
1468 2: draft
1471 2: draft
1469 $ echo '[mq]' >> $HGRCPATH
1472 $ echo '[mq]' >> $HGRCPATH
1470 $ echo 'secret=true' >> $HGRCPATH
1473 $ echo 'secret=true' >> $HGRCPATH
1471 $ rm -f .hg/store/phaseroots
1474 $ rm -f .hg/store/phaseroots
1472 $ hg phase 'qparent::'
1475 $ hg phase 'qparent::'
1473 0: secret
1476 0: secret
1474 1: secret
1477 1: secret
1475 2: secret
1478 2: secret
1476
1479
1477 Test that qfinish change phase when mq.secret=true
1480 Test that qfinish change phase when mq.secret=true
1478
1481
1479 $ hg qfinish qbase
1482 $ hg qfinish qbase
1480 patch add-file1 finalized without changeset message
1483 patch add-file1 finalized without changeset message
1481 $ hg phase 'all()'
1484 $ hg phase 'all()'
1482 0: draft
1485 0: draft
1483 1: secret
1486 1: secret
1484 2: secret
1487 2: secret
1485
1488
1486 Test that qfinish respect phases.new-commit setting
1489 Test that qfinish respect phases.new-commit setting
1487
1490
1488 $ echo '[phases]' >> $HGRCPATH
1491 $ echo '[phases]' >> $HGRCPATH
1489 $ echo 'new-commit=secret' >> $HGRCPATH
1492 $ echo 'new-commit=secret' >> $HGRCPATH
1490 $ hg qfinish qbase
1493 $ hg qfinish qbase
1491 patch add-file2 finalized without changeset message
1494 patch add-file2 finalized without changeset message
1492 $ hg phase 'all()'
1495 $ hg phase 'all()'
1493 0: draft
1496 0: draft
1494 1: secret
1497 1: secret
1495 2: secret
1498 2: secret
1496
1499
1497 (restore env for next test)
1500 (restore env for next test)
1498
1501
1499 $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH
1502 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1503 $ cp $TESTTMP/sedtmp $HGRCPATH
1500 $ hg qimport -r 1 --name add-file2
1504 $ hg qimport -r 1 --name add-file2
1501
1505
1502 Test that qfinish preserve phase when mq.secret=false
1506 Test that qfinish preserve phase when mq.secret=false
1503
1507
1504 $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH
1508 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1509 $ cp $TESTTMP/sedtmp $HGRCPATH
1505 $ hg qfinish qbase
1510 $ hg qfinish qbase
1506 patch add-file2 finalized without changeset message
1511 patch add-file2 finalized without changeset message
1507 $ hg phase 'all()'
1512 $ hg phase 'all()'
1508 0: draft
1513 0: draft
1509 1: secret
1514 1: secret
1510 2: secret
1515 2: secret
General Comments 0
You need to be logged in to leave comments. Login now