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