##// END OF EJS Templates
tests: fix portability of sed expression in test-mq
Matt Mackall -
r16327:7c76587f stable
parent child Browse files
Show More
@@ -1,1510 +1,1510
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 -i.bak '2i\# make qtip index different in series and fullseries' `hg root`/.hg/patches/series
523 $ cat `hg root`/.hg/patches/series
523 $ cat `hg root`/.hg/patches/series
524 # comment
524 # comment
525 # make qtip index different in series and fullseries
525 # make qtip index different in series and fullseries
526
526
527 test.patch
527 test.patch
528 test1b.patch
528 test1b.patch
529 test2.patch
529 test2.patch
530 $ hg qpush --move test2.patch
530 $ hg qpush --move test2.patch
531 applying test2.patch
531 applying test2.patch
532 now at: test2.patch
532 now at: test2.patch
533
533
534
534
535 series after move
535 series after move
536
536
537 $ cat `hg root`/.hg/patches/series
537 $ cat `hg root`/.hg/patches/series
538 # comment
538 # comment
539 # make qtip index different in series and fullseries
539 # make qtip index different in series and fullseries
540
540
541 test.patch
541 test.patch
542 test1b.patch
542 test1b.patch
543 test2.patch
543 test2.patch
544
544
545
545
546 pop, qapplied, qunapplied
546 pop, qapplied, qunapplied
547
547
548 $ hg qseries -v
548 $ hg qseries -v
549 0 A test.patch
549 0 A test.patch
550 1 A test1b.patch
550 1 A test1b.patch
551 2 A test2.patch
551 2 A test2.patch
552
552
553 qapplied -1 test.patch
553 qapplied -1 test.patch
554
554
555 $ hg qapplied -1 test.patch
555 $ hg qapplied -1 test.patch
556 only one patch applied
556 only one patch applied
557 [1]
557 [1]
558
558
559 qapplied -1 test1b.patch
559 qapplied -1 test1b.patch
560
560
561 $ hg qapplied -1 test1b.patch
561 $ hg qapplied -1 test1b.patch
562 test.patch
562 test.patch
563
563
564 qapplied -1 test2.patch
564 qapplied -1 test2.patch
565
565
566 $ hg qapplied -1 test2.patch
566 $ hg qapplied -1 test2.patch
567 test1b.patch
567 test1b.patch
568
568
569 qapplied -1
569 qapplied -1
570
570
571 $ hg qapplied -1
571 $ hg qapplied -1
572 test1b.patch
572 test1b.patch
573
573
574 qapplied
574 qapplied
575
575
576 $ hg qapplied
576 $ hg qapplied
577 test.patch
577 test.patch
578 test1b.patch
578 test1b.patch
579 test2.patch
579 test2.patch
580
580
581 qapplied test1b.patch
581 qapplied test1b.patch
582
582
583 $ hg qapplied test1b.patch
583 $ hg qapplied test1b.patch
584 test.patch
584 test.patch
585 test1b.patch
585 test1b.patch
586
586
587 qunapplied -1
587 qunapplied -1
588
588
589 $ hg qunapplied -1
589 $ hg qunapplied -1
590 all patches applied
590 all patches applied
591 [1]
591 [1]
592
592
593 qunapplied
593 qunapplied
594
594
595 $ hg qunapplied
595 $ hg qunapplied
596
596
597 popping
597 popping
598
598
599 $ hg qpop
599 $ hg qpop
600 popping test2.patch
600 popping test2.patch
601 now at: test1b.patch
601 now at: test1b.patch
602
602
603 qunapplied -1
603 qunapplied -1
604
604
605 $ hg qunapplied -1
605 $ hg qunapplied -1
606 test2.patch
606 test2.patch
607
607
608 qunapplied
608 qunapplied
609
609
610 $ hg qunapplied
610 $ hg qunapplied
611 test2.patch
611 test2.patch
612
612
613 qunapplied test2.patch
613 qunapplied test2.patch
614
614
615 $ hg qunapplied test2.patch
615 $ hg qunapplied test2.patch
616
616
617 qunapplied -1 test2.patch
617 qunapplied -1 test2.patch
618
618
619 $ hg qunapplied -1 test2.patch
619 $ hg qunapplied -1 test2.patch
620 all patches applied
620 all patches applied
621 [1]
621 [1]
622
622
623 popping -a
623 popping -a
624
624
625 $ hg qpop -a
625 $ hg qpop -a
626 popping test1b.patch
626 popping test1b.patch
627 popping test.patch
627 popping test.patch
628 patch queue now empty
628 patch queue now empty
629
629
630 qapplied
630 qapplied
631
631
632 $ hg qapplied
632 $ hg qapplied
633
633
634 qapplied -1
634 qapplied -1
635
635
636 $ hg qapplied -1
636 $ hg qapplied -1
637 no patches applied
637 no patches applied
638 [1]
638 [1]
639 $ hg qpush
639 $ hg qpush
640 applying test.patch
640 applying test.patch
641 now at: test.patch
641 now at: test.patch
642
642
643
643
644 push should succeed
644 push should succeed
645
645
646 $ hg qpop -a
646 $ hg qpop -a
647 popping test.patch
647 popping test.patch
648 patch queue now empty
648 patch queue now empty
649 $ hg push ../../k
649 $ hg push ../../k
650 pushing to ../../k
650 pushing to ../../k
651 searching for changes
651 searching for changes
652 adding changesets
652 adding changesets
653 adding manifests
653 adding manifests
654 adding file changes
654 adding file changes
655 added 1 changesets with 1 changes to 1 files
655 added 1 changesets with 1 changes to 1 files
656
656
657
657
658 we want to start with some patches applied
658 we want to start with some patches applied
659
659
660 $ hg qpush -a
660 $ hg qpush -a
661 applying test.patch
661 applying test.patch
662 applying test1b.patch
662 applying test1b.patch
663 applying test2.patch
663 applying test2.patch
664 now at: test2.patch
664 now at: test2.patch
665
665
666 % pops all patches and succeeds
666 % pops all patches and succeeds
667
667
668 $ hg qpop -a
668 $ hg qpop -a
669 popping test2.patch
669 popping test2.patch
670 popping test1b.patch
670 popping test1b.patch
671 popping test.patch
671 popping test.patch
672 patch queue now empty
672 patch queue now empty
673
673
674 % does nothing and succeeds
674 % does nothing and succeeds
675
675
676 $ hg qpop -a
676 $ hg qpop -a
677 no patches applied
677 no patches applied
678
678
679 % fails - nothing else to pop
679 % fails - nothing else to pop
680
680
681 $ hg qpop
681 $ hg qpop
682 no patches applied
682 no patches applied
683 [1]
683 [1]
684
684
685 % pushes a patch and succeeds
685 % pushes a patch and succeeds
686
686
687 $ hg qpush
687 $ hg qpush
688 applying test.patch
688 applying test.patch
689 now at: test.patch
689 now at: test.patch
690
690
691 % pops a patch and succeeds
691 % pops a patch and succeeds
692
692
693 $ hg qpop
693 $ hg qpop
694 popping test.patch
694 popping test.patch
695 patch queue now empty
695 patch queue now empty
696
696
697 % pushes up to test1b.patch and succeeds
697 % pushes up to test1b.patch and succeeds
698
698
699 $ hg qpush test1b.patch
699 $ hg qpush test1b.patch
700 applying test.patch
700 applying test.patch
701 applying test1b.patch
701 applying test1b.patch
702 now at: test1b.patch
702 now at: test1b.patch
703
703
704 % does nothing and succeeds
704 % does nothing and succeeds
705
705
706 $ hg qpush test1b.patch
706 $ hg qpush test1b.patch
707 qpush: test1b.patch is already at the top
707 qpush: test1b.patch is already at the top
708
708
709 % does nothing and succeeds
709 % does nothing and succeeds
710
710
711 $ hg qpop test1b.patch
711 $ hg qpop test1b.patch
712 qpop: test1b.patch is already at the top
712 qpop: test1b.patch is already at the top
713
713
714 % fails - can't push to this patch
714 % fails - can't push to this patch
715
715
716 $ hg qpush test.patch
716 $ hg qpush test.patch
717 abort: cannot push to a previous patch: test.patch
717 abort: cannot push to a previous patch: test.patch
718 [255]
718 [255]
719
719
720 % fails - can't pop to this patch
720 % fails - can't pop to this patch
721
721
722 $ hg qpop test2.patch
722 $ hg qpop test2.patch
723 abort: patch test2.patch is not applied
723 abort: patch test2.patch is not applied
724 [255]
724 [255]
725
725
726 % pops up to test.patch and succeeds
726 % pops up to test.patch and succeeds
727
727
728 $ hg qpop test.patch
728 $ hg qpop test.patch
729 popping test1b.patch
729 popping test1b.patch
730 now at: test.patch
730 now at: test.patch
731
731
732 % pushes all patches and succeeds
732 % pushes all patches and succeeds
733
733
734 $ hg qpush -a
734 $ hg qpush -a
735 applying test1b.patch
735 applying test1b.patch
736 applying test2.patch
736 applying test2.patch
737 now at: test2.patch
737 now at: test2.patch
738
738
739 % does nothing and succeeds
739 % does nothing and succeeds
740
740
741 $ hg qpush -a
741 $ hg qpush -a
742 all patches are currently applied
742 all patches are currently applied
743
743
744 % fails - nothing else to push
744 % fails - nothing else to push
745
745
746 $ hg qpush
746 $ hg qpush
747 patch series already fully applied
747 patch series already fully applied
748 [1]
748 [1]
749
749
750 % does nothing and succeeds
750 % does nothing and succeeds
751
751
752 $ hg qpush test2.patch
752 $ hg qpush test2.patch
753 qpush: test2.patch is already at the top
753 qpush: test2.patch is already at the top
754
754
755 strip
755 strip
756
756
757 $ cd ../../b
757 $ cd ../../b
758 $ echo x>x
758 $ echo x>x
759 $ hg ci -Ama
759 $ hg ci -Ama
760 adding x
760 adding x
761 $ hg strip tip
761 $ hg strip tip
762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
762 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)
763 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
764 $ hg unbundle .hg/strip-backup/*
764 $ hg unbundle .hg/strip-backup/*
765 adding changesets
765 adding changesets
766 adding manifests
766 adding manifests
767 adding file changes
767 adding file changes
768 added 1 changesets with 1 changes to 1 files
768 added 1 changesets with 1 changes to 1 files
769 (run 'hg update' to get a working copy)
769 (run 'hg update' to get a working copy)
770
770
771
771
772 strip with local changes, should complain
772 strip with local changes, should complain
773
773
774 $ hg up
774 $ hg up
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 $ echo y>y
776 $ echo y>y
777 $ hg add y
777 $ hg add y
778 $ hg strip tip
778 $ hg strip tip
779 abort: local changes found
779 abort: local changes found
780 [255]
780 [255]
781
781
782 --force strip with local changes
782 --force strip with local changes
783
783
784 $ hg strip -f tip
784 $ hg strip -f tip
785 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
785 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)
786 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
787
787
788
788
789 cd b; hg qrefresh
789 cd b; hg qrefresh
790
790
791 $ hg init refresh
791 $ hg init refresh
792 $ cd refresh
792 $ cd refresh
793 $ echo a > a
793 $ echo a > a
794 $ hg ci -Ama
794 $ hg ci -Ama
795 adding a
795 adding a
796 $ hg qnew -mfoo foo
796 $ hg qnew -mfoo foo
797 $ echo a >> a
797 $ echo a >> a
798 $ hg qrefresh
798 $ hg qrefresh
799 $ mkdir b
799 $ mkdir b
800 $ cd b
800 $ cd b
801 $ echo f > f
801 $ echo f > f
802 $ hg add f
802 $ hg add f
803 $ hg qrefresh
803 $ hg qrefresh
804 $ cat ../.hg/patches/foo
804 $ cat ../.hg/patches/foo
805 foo
805 foo
806
806
807 diff -r cb9a9f314b8b a
807 diff -r cb9a9f314b8b a
808 --- a/a\t(?P<date>.*) (re)
808 --- a/a\t(?P<date>.*) (re)
809 \+\+\+ b/a\t(?P<date>.*) (re)
809 \+\+\+ b/a\t(?P<date>.*) (re)
810 @@ -1,1 +1,2 @@
810 @@ -1,1 +1,2 @@
811 a
811 a
812 +a
812 +a
813 diff -r cb9a9f314b8b b/f
813 diff -r cb9a9f314b8b b/f
814 --- /dev/null\t(?P<date>.*) (re)
814 --- /dev/null\t(?P<date>.*) (re)
815 \+\+\+ b/b/f\t(?P<date>.*) (re)
815 \+\+\+ b/b/f\t(?P<date>.*) (re)
816 @@ -0,0 +1,1 @@
816 @@ -0,0 +1,1 @@
817 +f
817 +f
818
818
819 hg qrefresh .
819 hg qrefresh .
820
820
821 $ hg qrefresh .
821 $ hg qrefresh .
822 $ cat ../.hg/patches/foo
822 $ cat ../.hg/patches/foo
823 foo
823 foo
824
824
825 diff -r cb9a9f314b8b b/f
825 diff -r cb9a9f314b8b b/f
826 --- /dev/null\t(?P<date>.*) (re)
826 --- /dev/null\t(?P<date>.*) (re)
827 \+\+\+ b/b/f\t(?P<date>.*) (re)
827 \+\+\+ b/b/f\t(?P<date>.*) (re)
828 @@ -0,0 +1,1 @@
828 @@ -0,0 +1,1 @@
829 +f
829 +f
830 $ hg status
830 $ hg status
831 M a
831 M a
832
832
833
833
834 qpush failure
834 qpush failure
835
835
836 $ cd ..
836 $ cd ..
837 $ hg qrefresh
837 $ hg qrefresh
838 $ hg qnew -mbar bar
838 $ hg qnew -mbar bar
839 $ echo foo > foo
839 $ echo foo > foo
840 $ echo bar > bar
840 $ echo bar > bar
841 $ hg add foo bar
841 $ hg add foo bar
842 $ hg qrefresh
842 $ hg qrefresh
843 $ hg qpop -a
843 $ hg qpop -a
844 popping bar
844 popping bar
845 popping foo
845 popping foo
846 patch queue now empty
846 patch queue now empty
847 $ echo bar > foo
847 $ echo bar > foo
848 $ hg qpush -a
848 $ hg qpush -a
849 applying foo
849 applying foo
850 applying bar
850 applying bar
851 file foo already exists
851 file foo already exists
852 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
852 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
853 patch failed, unable to continue (try -v)
853 patch failed, unable to continue (try -v)
854 patch failed, rejects left in working dir
854 patch failed, rejects left in working dir
855 errors during apply, please fix and refresh bar
855 errors during apply, please fix and refresh bar
856 [2]
856 [2]
857 $ hg st
857 $ hg st
858 ? foo
858 ? foo
859 ? foo.rej
859 ? foo.rej
860
860
861
861
862 mq tags
862 mq tags
863
863
864 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
864 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
865 0 qparent
865 0 qparent
866 1 foo qbase
866 1 foo qbase
867 2 bar qtip tip
867 2 bar qtip tip
868
868
869 mq revset
869 mq revset
870
870
871 $ hg log -r 'mq()' --template '{rev}\n'
871 $ hg log -r 'mq()' --template '{rev}\n'
872 1
872 1
873 2
873 2
874 $ hg help revsets | grep -i mq
874 $ hg help revsets | grep -i mq
875 "mq()"
875 "mq()"
876 Changesets managed by MQ.
876 Changesets managed by MQ.
877
877
878 bad node in status
878 bad node in status
879
879
880 $ hg qpop
880 $ hg qpop
881 popping bar
881 popping bar
882 now at: foo
882 now at: foo
883 $ hg strip -qn tip
883 $ hg strip -qn tip
884 $ hg tip
884 $ hg tip
885 changeset: 0:cb9a9f314b8b
885 changeset: 0:cb9a9f314b8b
886 tag: tip
886 tag: tip
887 user: test
887 user: test
888 date: Thu Jan 01 00:00:00 1970 +0000
888 date: Thu Jan 01 00:00:00 1970 +0000
889 summary: a
889 summary: a
890
890
891 $ hg branches
891 $ hg branches
892 default 0:cb9a9f314b8b
892 default 0:cb9a9f314b8b
893 $ hg qpop
893 $ hg qpop
894 no patches applied
894 no patches applied
895 [1]
895 [1]
896
896
897 $ cat >>$HGRCPATH <<EOF
897 $ cat >>$HGRCPATH <<EOF
898 > [diff]
898 > [diff]
899 > git = True
899 > git = True
900 > EOF
900 > EOF
901 $ cd ..
901 $ cd ..
902 $ hg init git
902 $ hg init git
903 $ cd git
903 $ cd git
904 $ hg qinit
904 $ hg qinit
905
905
906 $ hg qnew -m'new file' new
906 $ hg qnew -m'new file' new
907 $ echo foo > new
907 $ echo foo > new
908 $ chmod +x new
908 $ chmod +x new
909 $ hg add new
909 $ hg add new
910 $ hg qrefresh
910 $ hg qrefresh
911 $ cat .hg/patches/new
911 $ cat .hg/patches/new
912 new file
912 new file
913
913
914 diff --git a/new b/new
914 diff --git a/new b/new
915 new file mode 100755
915 new file mode 100755
916 --- /dev/null
916 --- /dev/null
917 +++ b/new
917 +++ b/new
918 @@ -0,0 +1,1 @@
918 @@ -0,0 +1,1 @@
919 +foo
919 +foo
920
920
921 $ hg qnew -m'copy file' copy
921 $ hg qnew -m'copy file' copy
922 $ hg cp new copy
922 $ hg cp new copy
923 $ hg qrefresh
923 $ hg qrefresh
924 $ cat .hg/patches/copy
924 $ cat .hg/patches/copy
925 copy file
925 copy file
926
926
927 diff --git a/new b/copy
927 diff --git a/new b/copy
928 copy from new
928 copy from new
929 copy to copy
929 copy to copy
930
930
931 $ hg qpop
931 $ hg qpop
932 popping copy
932 popping copy
933 now at: new
933 now at: new
934 $ hg qpush
934 $ hg qpush
935 applying copy
935 applying copy
936 now at: copy
936 now at: copy
937 $ hg qdiff
937 $ hg qdiff
938 diff --git a/new b/copy
938 diff --git a/new b/copy
939 copy from new
939 copy from new
940 copy to copy
940 copy to copy
941 $ cat >>$HGRCPATH <<EOF
941 $ cat >>$HGRCPATH <<EOF
942 > [diff]
942 > [diff]
943 > git = False
943 > git = False
944 > EOF
944 > EOF
945 $ hg qdiff --git
945 $ hg qdiff --git
946 diff --git a/new b/copy
946 diff --git a/new b/copy
947 copy from new
947 copy from new
948 copy to copy
948 copy to copy
949 $ cd ..
949 $ cd ..
950
950
951 empty lines in status
951 empty lines in status
952
952
953 $ hg init emptystatus
953 $ hg init emptystatus
954 $ cd emptystatus
954 $ cd emptystatus
955 $ hg qinit
955 $ hg qinit
956 $ printf '\n\n' > .hg/patches/status
956 $ printf '\n\n' > .hg/patches/status
957 $ hg qser
957 $ hg qser
958 $ cd ..
958 $ cd ..
959
959
960 bad line in status (without ":")
960 bad line in status (without ":")
961
961
962 $ hg init badstatus
962 $ hg init badstatus
963 $ cd badstatus
963 $ cd badstatus
964 $ hg qinit
964 $ hg qinit
965 $ printf 'babar has no colon in this line\n' > .hg/patches/status
965 $ printf 'babar has no colon in this line\n' > .hg/patches/status
966 $ hg qser
966 $ hg qser
967 malformated mq status line: ['babar has no colon in this line']
967 malformated mq status line: ['babar has no colon in this line']
968 $ cd ..
968 $ cd ..
969
969
970
970
971 test file addition in slow path
971 test file addition in slow path
972
972
973 $ hg init slow
973 $ hg init slow
974 $ cd slow
974 $ cd slow
975 $ hg qinit
975 $ hg qinit
976 $ echo foo > foo
976 $ echo foo > foo
977 $ hg add foo
977 $ hg add foo
978 $ hg ci -m 'add foo'
978 $ hg ci -m 'add foo'
979 $ hg qnew bar
979 $ hg qnew bar
980 $ echo bar > bar
980 $ echo bar > bar
981 $ hg add bar
981 $ hg add bar
982 $ hg mv foo baz
982 $ hg mv foo baz
983 $ hg qrefresh --git
983 $ hg qrefresh --git
984 $ hg up -C 0
984 $ hg up -C 0
985 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
985 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
986 $ echo >> foo
986 $ echo >> foo
987 $ hg ci -m 'change foo'
987 $ hg ci -m 'change foo'
988 created new head
988 created new head
989 $ hg up -C 1
989 $ hg up -C 1
990 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
990 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
991 $ hg qrefresh --git
991 $ hg qrefresh --git
992 $ cat .hg/patches/bar
992 $ cat .hg/patches/bar
993 diff --git a/bar b/bar
993 diff --git a/bar b/bar
994 new file mode 100644
994 new file mode 100644
995 --- /dev/null
995 --- /dev/null
996 +++ b/bar
996 +++ b/bar
997 @@ -0,0 +1,1 @@
997 @@ -0,0 +1,1 @@
998 +bar
998 +bar
999 diff --git a/foo b/baz
999 diff --git a/foo b/baz
1000 rename from foo
1000 rename from foo
1001 rename to baz
1001 rename to baz
1002 $ hg log -v --template '{rev} {file_copies}\n' -r .
1002 $ hg log -v --template '{rev} {file_copies}\n' -r .
1003 2 baz (foo)
1003 2 baz (foo)
1004 $ hg qrefresh --git
1004 $ hg qrefresh --git
1005 $ cat .hg/patches/bar
1005 $ cat .hg/patches/bar
1006 diff --git a/bar b/bar
1006 diff --git a/bar b/bar
1007 new file mode 100644
1007 new file mode 100644
1008 --- /dev/null
1008 --- /dev/null
1009 +++ b/bar
1009 +++ b/bar
1010 @@ -0,0 +1,1 @@
1010 @@ -0,0 +1,1 @@
1011 +bar
1011 +bar
1012 diff --git a/foo b/baz
1012 diff --git a/foo b/baz
1013 rename from foo
1013 rename from foo
1014 rename to baz
1014 rename to baz
1015 $ hg log -v --template '{rev} {file_copies}\n' -r .
1015 $ hg log -v --template '{rev} {file_copies}\n' -r .
1016 2 baz (foo)
1016 2 baz (foo)
1017 $ hg qrefresh
1017 $ hg qrefresh
1018 $ grep 'diff --git' .hg/patches/bar
1018 $ grep 'diff --git' .hg/patches/bar
1019 diff --git a/bar b/bar
1019 diff --git a/bar b/bar
1020 diff --git a/foo b/baz
1020 diff --git a/foo b/baz
1021
1021
1022
1022
1023 test file move chains in the slow path
1023 test file move chains in the slow path
1024
1024
1025 $ hg up -C 1
1025 $ hg up -C 1
1026 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1026 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1027 $ echo >> foo
1027 $ echo >> foo
1028 $ hg ci -m 'change foo again'
1028 $ hg ci -m 'change foo again'
1029 $ hg up -C 2
1029 $ hg up -C 2
1030 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1030 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1031 $ hg mv bar quux
1031 $ hg mv bar quux
1032 $ hg mv baz bleh
1032 $ hg mv baz bleh
1033 $ hg qrefresh --git
1033 $ hg qrefresh --git
1034 $ cat .hg/patches/bar
1034 $ cat .hg/patches/bar
1035 diff --git a/foo b/bleh
1035 diff --git a/foo b/bleh
1036 rename from foo
1036 rename from foo
1037 rename to bleh
1037 rename to bleh
1038 diff --git a/quux b/quux
1038 diff --git a/quux b/quux
1039 new file mode 100644
1039 new file mode 100644
1040 --- /dev/null
1040 --- /dev/null
1041 +++ b/quux
1041 +++ b/quux
1042 @@ -0,0 +1,1 @@
1042 @@ -0,0 +1,1 @@
1043 +bar
1043 +bar
1044 $ hg log -v --template '{rev} {file_copies}\n' -r .
1044 $ hg log -v --template '{rev} {file_copies}\n' -r .
1045 3 bleh (foo)
1045 3 bleh (foo)
1046 $ hg mv quux fred
1046 $ hg mv quux fred
1047 $ hg mv bleh barney
1047 $ hg mv bleh barney
1048 $ hg qrefresh --git
1048 $ hg qrefresh --git
1049 $ cat .hg/patches/bar
1049 $ cat .hg/patches/bar
1050 diff --git a/foo b/barney
1050 diff --git a/foo b/barney
1051 rename from foo
1051 rename from foo
1052 rename to barney
1052 rename to barney
1053 diff --git a/fred b/fred
1053 diff --git a/fred b/fred
1054 new file mode 100644
1054 new file mode 100644
1055 --- /dev/null
1055 --- /dev/null
1056 +++ b/fred
1056 +++ b/fred
1057 @@ -0,0 +1,1 @@
1057 @@ -0,0 +1,1 @@
1058 +bar
1058 +bar
1059 $ hg log -v --template '{rev} {file_copies}\n' -r .
1059 $ hg log -v --template '{rev} {file_copies}\n' -r .
1060 3 barney (foo)
1060 3 barney (foo)
1061
1061
1062
1062
1063 refresh omitting an added file
1063 refresh omitting an added file
1064
1064
1065 $ hg qnew baz
1065 $ hg qnew baz
1066 $ echo newfile > newfile
1066 $ echo newfile > newfile
1067 $ hg add newfile
1067 $ hg add newfile
1068 $ hg qrefresh
1068 $ hg qrefresh
1069 $ hg st -A newfile
1069 $ hg st -A newfile
1070 C newfile
1070 C newfile
1071 $ hg qrefresh -X newfile
1071 $ hg qrefresh -X newfile
1072 $ hg st -A newfile
1072 $ hg st -A newfile
1073 A newfile
1073 A newfile
1074 $ hg revert newfile
1074 $ hg revert newfile
1075 $ rm newfile
1075 $ rm newfile
1076 $ hg qpop
1076 $ hg qpop
1077 popping baz
1077 popping baz
1078 now at: bar
1078 now at: bar
1079 $ hg qdel baz
1079 $ hg qdel baz
1080
1080
1081
1081
1082 create a git patch
1082 create a git patch
1083
1083
1084 $ echo a > alexander
1084 $ echo a > alexander
1085 $ hg add alexander
1085 $ hg add alexander
1086 $ hg qnew -f --git addalexander
1086 $ hg qnew -f --git addalexander
1087 $ grep diff .hg/patches/addalexander
1087 $ grep diff .hg/patches/addalexander
1088 diff --git a/alexander b/alexander
1088 diff --git a/alexander b/alexander
1089
1089
1090
1090
1091 create a git binary patch
1091 create a git binary patch
1092
1092
1093 $ cat > writebin.py <<EOF
1093 $ cat > writebin.py <<EOF
1094 > import sys
1094 > import sys
1095 > path = sys.argv[1]
1095 > path = sys.argv[1]
1096 > open(path, 'wb').write('BIN\x00ARY')
1096 > open(path, 'wb').write('BIN\x00ARY')
1097 > EOF
1097 > EOF
1098 $ python writebin.py bucephalus
1098 $ python writebin.py bucephalus
1099
1099
1100 $ python "$TESTDIR/md5sum.py" bucephalus
1100 $ python "$TESTDIR/md5sum.py" bucephalus
1101 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1101 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1102 $ hg add bucephalus
1102 $ hg add bucephalus
1103 $ hg qnew -f --git addbucephalus
1103 $ hg qnew -f --git addbucephalus
1104 $ grep diff .hg/patches/addbucephalus
1104 $ grep diff .hg/patches/addbucephalus
1105 diff --git a/bucephalus b/bucephalus
1105 diff --git a/bucephalus b/bucephalus
1106
1106
1107
1107
1108 check binary patches can be popped and pushed
1108 check binary patches can be popped and pushed
1109
1109
1110 $ hg qpop
1110 $ hg qpop
1111 popping addbucephalus
1111 popping addbucephalus
1112 now at: addalexander
1112 now at: addalexander
1113 $ test -f bucephalus && echo % bucephalus should not be there
1113 $ test -f bucephalus && echo % bucephalus should not be there
1114 [1]
1114 [1]
1115 $ hg qpush
1115 $ hg qpush
1116 applying addbucephalus
1116 applying addbucephalus
1117 now at: addbucephalus
1117 now at: addbucephalus
1118 $ test -f bucephalus
1118 $ test -f bucephalus
1119 $ python "$TESTDIR/md5sum.py" bucephalus
1119 $ python "$TESTDIR/md5sum.py" bucephalus
1120 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1120 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1121
1121
1122
1122
1123
1123
1124 strip again
1124 strip again
1125
1125
1126 $ cd ..
1126 $ cd ..
1127 $ hg init strip
1127 $ hg init strip
1128 $ cd strip
1128 $ cd strip
1129 $ touch foo
1129 $ touch foo
1130 $ hg add foo
1130 $ hg add foo
1131 $ hg ci -m 'add foo'
1131 $ hg ci -m 'add foo'
1132 $ echo >> foo
1132 $ echo >> foo
1133 $ hg ci -m 'change foo 1'
1133 $ hg ci -m 'change foo 1'
1134 $ hg up -C 0
1134 $ hg up -C 0
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 $ echo 1 >> foo
1136 $ echo 1 >> foo
1137 $ hg ci -m 'change foo 2'
1137 $ hg ci -m 'change foo 2'
1138 created new head
1138 created new head
1139 $ HGMERGE=true hg merge
1139 $ HGMERGE=true hg merge
1140 merging foo
1140 merging foo
1141 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1141 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1142 (branch merge, don't forget to commit)
1142 (branch merge, don't forget to commit)
1143 $ hg ci -m merge
1143 $ hg ci -m merge
1144 $ hg log
1144 $ hg log
1145 changeset: 3:99615015637b
1145 changeset: 3:99615015637b
1146 tag: tip
1146 tag: tip
1147 parent: 2:20cbbe65cff7
1147 parent: 2:20cbbe65cff7
1148 parent: 1:d2871fc282d4
1148 parent: 1:d2871fc282d4
1149 user: test
1149 user: test
1150 date: Thu Jan 01 00:00:00 1970 +0000
1150 date: Thu Jan 01 00:00:00 1970 +0000
1151 summary: merge
1151 summary: merge
1152
1152
1153 changeset: 2:20cbbe65cff7
1153 changeset: 2:20cbbe65cff7
1154 parent: 0:53245c60e682
1154 parent: 0:53245c60e682
1155 user: test
1155 user: test
1156 date: Thu Jan 01 00:00:00 1970 +0000
1156 date: Thu Jan 01 00:00:00 1970 +0000
1157 summary: change foo 2
1157 summary: change foo 2
1158
1158
1159 changeset: 1:d2871fc282d4
1159 changeset: 1:d2871fc282d4
1160 user: test
1160 user: test
1161 date: Thu Jan 01 00:00:00 1970 +0000
1161 date: Thu Jan 01 00:00:00 1970 +0000
1162 summary: change foo 1
1162 summary: change foo 1
1163
1163
1164 changeset: 0:53245c60e682
1164 changeset: 0:53245c60e682
1165 user: test
1165 user: test
1166 date: Thu Jan 01 00:00:00 1970 +0000
1166 date: Thu Jan 01 00:00:00 1970 +0000
1167 summary: add foo
1167 summary: add foo
1168
1168
1169 $ hg strip 1
1169 $ hg strip 1
1170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1170 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)
1171 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1172 $ checkundo strip
1172 $ checkundo strip
1173 $ hg log
1173 $ hg log
1174 changeset: 1:20cbbe65cff7
1174 changeset: 1:20cbbe65cff7
1175 tag: tip
1175 tag: tip
1176 user: test
1176 user: test
1177 date: Thu Jan 01 00:00:00 1970 +0000
1177 date: Thu Jan 01 00:00:00 1970 +0000
1178 summary: change foo 2
1178 summary: change foo 2
1179
1179
1180 changeset: 0:53245c60e682
1180 changeset: 0:53245c60e682
1181 user: test
1181 user: test
1182 date: Thu Jan 01 00:00:00 1970 +0000
1182 date: Thu Jan 01 00:00:00 1970 +0000
1183 summary: add foo
1183 summary: add foo
1184
1184
1185 $ cd ..
1185 $ cd ..
1186
1186
1187
1187
1188 qclone
1188 qclone
1189
1189
1190 $ qlog()
1190 $ qlog()
1191 > {
1191 > {
1192 > echo 'main repo:'
1192 > echo 'main repo:'
1193 > hg log --template ' rev {rev}: {desc}\n'
1193 > hg log --template ' rev {rev}: {desc}\n'
1194 > echo 'patch repo:'
1194 > echo 'patch repo:'
1195 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1195 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1196 > }
1196 > }
1197 $ hg init qclonesource
1197 $ hg init qclonesource
1198 $ cd qclonesource
1198 $ cd qclonesource
1199 $ echo foo > foo
1199 $ echo foo > foo
1200 $ hg add foo
1200 $ hg add foo
1201 $ hg ci -m 'add foo'
1201 $ hg ci -m 'add foo'
1202 $ hg qinit
1202 $ hg qinit
1203 $ hg qnew patch1
1203 $ hg qnew patch1
1204 $ echo bar >> foo
1204 $ echo bar >> foo
1205 $ hg qrefresh -m 'change foo'
1205 $ hg qrefresh -m 'change foo'
1206 $ cd ..
1206 $ cd ..
1207
1207
1208
1208
1209 repo with unversioned patch dir
1209 repo with unversioned patch dir
1210
1210
1211 $ hg qclone qclonesource failure
1211 $ hg qclone qclonesource failure
1212 abort: versioned patch repository not found (see init --mq)
1212 abort: versioned patch repository not found (see init --mq)
1213 [255]
1213 [255]
1214
1214
1215 $ cd qclonesource
1215 $ cd qclonesource
1216 $ hg qinit -c
1216 $ hg qinit -c
1217 adding .hg/patches/patch1 (glob)
1217 adding .hg/patches/patch1 (glob)
1218 $ hg qci -m checkpoint
1218 $ hg qci -m checkpoint
1219 $ qlog
1219 $ qlog
1220 main repo:
1220 main repo:
1221 rev 1: change foo
1221 rev 1: change foo
1222 rev 0: add foo
1222 rev 0: add foo
1223 patch repo:
1223 patch repo:
1224 rev 0: checkpoint
1224 rev 0: checkpoint
1225 $ cd ..
1225 $ cd ..
1226
1226
1227
1227
1228 repo with patches applied
1228 repo with patches applied
1229
1229
1230 $ hg qclone qclonesource qclonedest
1230 $ hg qclone qclonesource qclonedest
1231 updating to branch default
1231 updating to branch default
1232 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1232 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
1233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1234 $ cd qclonedest
1234 $ cd qclonedest
1235 $ qlog
1235 $ qlog
1236 main repo:
1236 main repo:
1237 rev 0: add foo
1237 rev 0: add foo
1238 patch repo:
1238 patch repo:
1239 rev 0: checkpoint
1239 rev 0: checkpoint
1240 $ cd ..
1240 $ cd ..
1241
1241
1242
1242
1243 repo with patches unapplied
1243 repo with patches unapplied
1244
1244
1245 $ cd qclonesource
1245 $ cd qclonesource
1246 $ hg qpop -a
1246 $ hg qpop -a
1247 popping patch1
1247 popping patch1
1248 patch queue now empty
1248 patch queue now empty
1249 $ qlog
1249 $ qlog
1250 main repo:
1250 main repo:
1251 rev 0: add foo
1251 rev 0: add foo
1252 patch repo:
1252 patch repo:
1253 rev 0: checkpoint
1253 rev 0: checkpoint
1254 $ cd ..
1254 $ cd ..
1255 $ hg qclone qclonesource qclonedest2
1255 $ hg qclone qclonesource qclonedest2
1256 updating to branch default
1256 updating to branch default
1257 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1257 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
1258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 $ cd qclonedest2
1259 $ cd qclonedest2
1260 $ qlog
1260 $ qlog
1261 main repo:
1261 main repo:
1262 rev 0: add foo
1262 rev 0: add foo
1263 patch repo:
1263 patch repo:
1264 rev 0: checkpoint
1264 rev 0: checkpoint
1265 $ cd ..
1265 $ cd ..
1266
1266
1267
1267
1268 Issue1033: test applying on an empty file
1268 Issue1033: test applying on an empty file
1269
1269
1270 $ hg init empty
1270 $ hg init empty
1271 $ cd empty
1271 $ cd empty
1272 $ touch a
1272 $ touch a
1273 $ hg ci -Am addempty
1273 $ hg ci -Am addempty
1274 adding a
1274 adding a
1275 $ echo a > a
1275 $ echo a > a
1276 $ hg qnew -f -e changea
1276 $ hg qnew -f -e changea
1277 $ hg qpop
1277 $ hg qpop
1278 popping changea
1278 popping changea
1279 patch queue now empty
1279 patch queue now empty
1280 $ hg qpush
1280 $ hg qpush
1281 applying changea
1281 applying changea
1282 now at: changea
1282 now at: changea
1283 $ cd ..
1283 $ cd ..
1284
1284
1285 test qpush with --force, issue1087
1285 test qpush with --force, issue1087
1286
1286
1287 $ hg init forcepush
1287 $ hg init forcepush
1288 $ cd forcepush
1288 $ cd forcepush
1289 $ echo hello > hello.txt
1289 $ echo hello > hello.txt
1290 $ echo bye > bye.txt
1290 $ echo bye > bye.txt
1291 $ hg ci -Ama
1291 $ hg ci -Ama
1292 adding bye.txt
1292 adding bye.txt
1293 adding hello.txt
1293 adding hello.txt
1294 $ hg qnew -d '0 0' empty
1294 $ hg qnew -d '0 0' empty
1295 $ hg qpop
1295 $ hg qpop
1296 popping empty
1296 popping empty
1297 patch queue now empty
1297 patch queue now empty
1298 $ echo world >> hello.txt
1298 $ echo world >> hello.txt
1299
1299
1300
1300
1301 qpush should fail, local changes
1301 qpush should fail, local changes
1302
1302
1303 $ hg qpush
1303 $ hg qpush
1304 abort: local changes found
1304 abort: local changes found
1305 [255]
1305 [255]
1306
1306
1307
1307
1308 apply force, should not discard changes with empty patch
1308 apply force, should not discard changes with empty patch
1309
1309
1310 $ hg qpush -f
1310 $ hg qpush -f
1311 applying empty
1311 applying empty
1312 patch empty is empty
1312 patch empty is empty
1313 now at: empty
1313 now at: empty
1314 $ hg diff --config diff.nodates=True
1314 $ hg diff --config diff.nodates=True
1315 diff -r d58265112590 hello.txt
1315 diff -r d58265112590 hello.txt
1316 --- a/hello.txt
1316 --- a/hello.txt
1317 +++ b/hello.txt
1317 +++ b/hello.txt
1318 @@ -1,1 +1,2 @@
1318 @@ -1,1 +1,2 @@
1319 hello
1319 hello
1320 +world
1320 +world
1321 $ hg qdiff --config diff.nodates=True
1321 $ hg qdiff --config diff.nodates=True
1322 diff -r 9ecee4f634e3 hello.txt
1322 diff -r 9ecee4f634e3 hello.txt
1323 --- a/hello.txt
1323 --- a/hello.txt
1324 +++ b/hello.txt
1324 +++ b/hello.txt
1325 @@ -1,1 +1,2 @@
1325 @@ -1,1 +1,2 @@
1326 hello
1326 hello
1327 +world
1327 +world
1328 $ hg log -l1 -p
1328 $ hg log -l1 -p
1329 changeset: 1:d58265112590
1329 changeset: 1:d58265112590
1330 tag: empty
1330 tag: empty
1331 tag: qbase
1331 tag: qbase
1332 tag: qtip
1332 tag: qtip
1333 tag: tip
1333 tag: tip
1334 user: test
1334 user: test
1335 date: Thu Jan 01 00:00:00 1970 +0000
1335 date: Thu Jan 01 00:00:00 1970 +0000
1336 summary: imported patch empty
1336 summary: imported patch empty
1337
1337
1338
1338
1339 $ hg qref -d '0 0'
1339 $ hg qref -d '0 0'
1340 $ hg qpop
1340 $ hg qpop
1341 popping empty
1341 popping empty
1342 patch queue now empty
1342 patch queue now empty
1343 $ echo universe >> hello.txt
1343 $ echo universe >> hello.txt
1344 $ echo universe >> bye.txt
1344 $ echo universe >> bye.txt
1345
1345
1346
1346
1347 qpush should fail, local changes
1347 qpush should fail, local changes
1348
1348
1349 $ hg qpush
1349 $ hg qpush
1350 abort: local changes found
1350 abort: local changes found
1351 [255]
1351 [255]
1352
1352
1353
1353
1354 apply force, should discard changes in hello, but not bye
1354 apply force, should discard changes in hello, but not bye
1355
1355
1356 $ hg qpush -f
1356 $ hg qpush -f
1357 applying empty
1357 applying empty
1358 now at: empty
1358 now at: empty
1359 $ hg st
1359 $ hg st
1360 M bye.txt
1360 M bye.txt
1361 $ hg diff --config diff.nodates=True
1361 $ hg diff --config diff.nodates=True
1362 diff -r ba252371dbc1 bye.txt
1362 diff -r ba252371dbc1 bye.txt
1363 --- a/bye.txt
1363 --- a/bye.txt
1364 +++ b/bye.txt
1364 +++ b/bye.txt
1365 @@ -1,1 +1,2 @@
1365 @@ -1,1 +1,2 @@
1366 bye
1366 bye
1367 +universe
1367 +universe
1368 $ hg qdiff --config diff.nodates=True
1368 $ hg qdiff --config diff.nodates=True
1369 diff -r 9ecee4f634e3 bye.txt
1369 diff -r 9ecee4f634e3 bye.txt
1370 --- a/bye.txt
1370 --- a/bye.txt
1371 +++ b/bye.txt
1371 +++ b/bye.txt
1372 @@ -1,1 +1,2 @@
1372 @@ -1,1 +1,2 @@
1373 bye
1373 bye
1374 +universe
1374 +universe
1375 diff -r 9ecee4f634e3 hello.txt
1375 diff -r 9ecee4f634e3 hello.txt
1376 --- a/hello.txt
1376 --- a/hello.txt
1377 +++ b/hello.txt
1377 +++ b/hello.txt
1378 @@ -1,1 +1,3 @@
1378 @@ -1,1 +1,3 @@
1379 hello
1379 hello
1380 +world
1380 +world
1381 +universe
1381 +universe
1382
1382
1383
1383
1384 test popping revisions not in working dir ancestry
1384 test popping revisions not in working dir ancestry
1385
1385
1386 $ hg qseries -v
1386 $ hg qseries -v
1387 0 A empty
1387 0 A empty
1388 $ hg up qparent
1388 $ hg up qparent
1389 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1389 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1390 $ hg qpop
1390 $ hg qpop
1391 popping empty
1391 popping empty
1392 patch queue now empty
1392 patch queue now empty
1393
1393
1394 $ cd ..
1394 $ cd ..
1395 $ hg init deletion-order
1395 $ hg init deletion-order
1396 $ cd deletion-order
1396 $ cd deletion-order
1397
1397
1398 $ touch a
1398 $ touch a
1399 $ hg ci -Aqm0
1399 $ hg ci -Aqm0
1400
1400
1401 $ hg qnew rename-dir
1401 $ hg qnew rename-dir
1402 $ hg rm a
1402 $ hg rm a
1403 $ hg qrefresh
1403 $ hg qrefresh
1404
1404
1405 $ mkdir a b
1405 $ mkdir a b
1406 $ touch a/a b/b
1406 $ touch a/a b/b
1407 $ hg add -q a b
1407 $ hg add -q a b
1408 $ hg qrefresh
1408 $ hg qrefresh
1409
1409
1410
1410
1411 test popping must remove files added in subdirectories first
1411 test popping must remove files added in subdirectories first
1412
1412
1413 $ hg qpop
1413 $ hg qpop
1414 popping rename-dir
1414 popping rename-dir
1415 patch queue now empty
1415 patch queue now empty
1416 $ cd ..
1416 $ cd ..
1417
1417
1418
1418
1419 test case preservation through patch pushing especially on case
1419 test case preservation through patch pushing especially on case
1420 insensitive filesystem
1420 insensitive filesystem
1421
1421
1422 $ hg init casepreserve
1422 $ hg init casepreserve
1423 $ cd casepreserve
1423 $ cd casepreserve
1424
1424
1425 $ hg qnew add-file1
1425 $ hg qnew add-file1
1426 $ echo a > TeXtFiLe.TxT
1426 $ echo a > TeXtFiLe.TxT
1427 $ hg add TeXtFiLe.TxT
1427 $ hg add TeXtFiLe.TxT
1428 $ hg qrefresh
1428 $ hg qrefresh
1429
1429
1430 $ hg qnew add-file2
1430 $ hg qnew add-file2
1431 $ echo b > AnOtHeRFiLe.TxT
1431 $ echo b > AnOtHeRFiLe.TxT
1432 $ hg add AnOtHeRFiLe.TxT
1432 $ hg add AnOtHeRFiLe.TxT
1433 $ hg qrefresh
1433 $ hg qrefresh
1434
1434
1435 $ hg qnew modify-file
1435 $ hg qnew modify-file
1436 $ echo c >> AnOtHeRFiLe.TxT
1436 $ echo c >> AnOtHeRFiLe.TxT
1437 $ hg qrefresh
1437 $ hg qrefresh
1438
1438
1439 $ hg qapplied
1439 $ hg qapplied
1440 add-file1
1440 add-file1
1441 add-file2
1441 add-file2
1442 modify-file
1442 modify-file
1443 $ hg qpop -a
1443 $ hg qpop -a
1444 popping modify-file
1444 popping modify-file
1445 popping add-file2
1445 popping add-file2
1446 popping add-file1
1446 popping add-file1
1447 patch queue now empty
1447 patch queue now empty
1448
1448
1449 this qpush causes problems below, if case preservation on case
1449 this qpush causes problems below, if case preservation on case
1450 insensitive filesystem is not enough:
1450 insensitive filesystem is not enough:
1451 (1) unexpected "adding ..." messages are shown
1451 (1) unexpected "adding ..." messages are shown
1452 (2) patching fails in modification of (1) files
1452 (2) patching fails in modification of (1) files
1453
1453
1454 $ hg qpush -a
1454 $ hg qpush -a
1455 applying add-file1
1455 applying add-file1
1456 applying add-file2
1456 applying add-file2
1457 applying modify-file
1457 applying modify-file
1458 now at: modify-file
1458 now at: modify-file
1459
1459
1460 Proper phase default with mq:
1460 Proper phase default with mq:
1461
1461
1462 1. mq.secret=false
1462 1. mq.secret=false
1463
1463
1464 $ rm .hg/store/phaseroots
1464 $ rm .hg/store/phaseroots
1465 $ hg phase 'qparent::'
1465 $ hg phase 'qparent::'
1466 0: draft
1466 0: draft
1467 1: draft
1467 1: draft
1468 2: draft
1468 2: draft
1469 $ echo '[mq]' >> $HGRCPATH
1469 $ echo '[mq]' >> $HGRCPATH
1470 $ echo 'secret=true' >> $HGRCPATH
1470 $ echo 'secret=true' >> $HGRCPATH
1471 $ rm -f .hg/store/phaseroots
1471 $ rm -f .hg/store/phaseroots
1472 $ hg phase 'qparent::'
1472 $ hg phase 'qparent::'
1473 0: secret
1473 0: secret
1474 1: secret
1474 1: secret
1475 2: secret
1475 2: secret
1476
1476
1477 Test that qfinish change phase when mq.secret=true
1477 Test that qfinish change phase when mq.secret=true
1478
1478
1479 $ hg qfinish qbase
1479 $ hg qfinish qbase
1480 patch add-file1 finalized without changeset message
1480 patch add-file1 finalized without changeset message
1481 $ hg phase 'all()'
1481 $ hg phase 'all()'
1482 0: draft
1482 0: draft
1483 1: secret
1483 1: secret
1484 2: secret
1484 2: secret
1485
1485
1486 Test that qfinish respect phases.new-commit setting
1486 Test that qfinish respect phases.new-commit setting
1487
1487
1488 $ echo '[phases]' >> $HGRCPATH
1488 $ echo '[phases]' >> $HGRCPATH
1489 $ echo 'new-commit=secret' >> $HGRCPATH
1489 $ echo 'new-commit=secret' >> $HGRCPATH
1490 $ hg qfinish qbase
1490 $ hg qfinish qbase
1491 patch add-file2 finalized without changeset message
1491 patch add-file2 finalized without changeset message
1492 $ hg phase 'all()'
1492 $ hg phase 'all()'
1493 0: draft
1493 0: draft
1494 1: secret
1494 1: secret
1495 2: secret
1495 2: secret
1496
1496
1497 (restore env for next test)
1497 (restore env for next test)
1498
1498
1499 $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH
1499 $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH
1500 $ hg qimport -r 1 --name add-file2
1500 $ hg qimport -r 1 --name add-file2
1501
1501
1502 Test that qfinish preserve phase when mq.secret=false
1502 Test that qfinish preserve phase when mq.secret=false
1503
1503
1504 $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH
1504 $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH
1505 $ hg qfinish qbase
1505 $ hg qfinish qbase
1506 patch add-file2 finalized without changeset message
1506 patch add-file2 finalized without changeset message
1507 $ hg phase 'all()'
1507 $ hg phase 'all()'
1508 0: draft
1508 0: draft
1509 1: secret
1509 1: secret
1510 2: secret
1510 2: secret
General Comments 0
You need to be logged in to leave comments. Login now