##// END OF EJS Templates
py3: make sure we write bytes to file...
Pulkit Goyal -
r37544:f5ffcac6 default
parent child Browse files
Show More
@@ -1,1604 +1,1604
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!
157 abort: repository $TESTTMP/d/.hg/patches already exists!
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
180 adding .hg/patches/A
181 adding .hg/patches/B
181 adding .hg/patches/B
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 new changesets 770eb8fce608
785 new changesets 770eb8fce608
786 (run 'hg update' to get a working copy)
786 (run 'hg update' to get a working copy)
787
787
788
788
789 strip with local changes, should complain
789 strip with local changes, should complain
790
790
791 $ hg up
791 $ hg up
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 $ echo y>y
793 $ echo y>y
794 $ hg add y
794 $ hg add y
795 $ hg strip tip
795 $ hg strip tip
796 abort: local changes found
796 abort: local changes found
797 [255]
797 [255]
798
798
799 --force strip with local changes
799 --force strip with local changes
800
800
801 $ hg strip -f tip
801 $ hg strip -f tip
802 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
802 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
803 saved backup bundle to $TESTTMP/b/.hg/strip-backup/770eb8fce608-0ddcae0f-backup.hg
803 saved backup bundle to $TESTTMP/b/.hg/strip-backup/770eb8fce608-0ddcae0f-backup.hg
804 $ cd ..
804 $ cd ..
805
805
806
806
807 cd b; hg qrefresh
807 cd b; hg qrefresh
808
808
809 $ hg init refresh
809 $ hg init refresh
810 $ cd refresh
810 $ cd refresh
811 $ echo a > a
811 $ echo a > a
812 $ hg ci -Ama
812 $ hg ci -Ama
813 adding a
813 adding a
814 $ hg qnew -mfoo foo
814 $ hg qnew -mfoo foo
815 $ echo a >> a
815 $ echo a >> a
816 $ hg qrefresh
816 $ hg qrefresh
817 $ mkdir b
817 $ mkdir b
818 $ cd b
818 $ cd b
819 $ echo f > f
819 $ echo f > f
820 $ hg add f
820 $ hg add f
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 a
825 diff -r cb9a9f314b8b a
826 --- a/a\t(?P<date>.*) (re)
826 --- a/a\t(?P<date>.*) (re)
827 \+\+\+ b/a\t(?P<date>.*) (re)
827 \+\+\+ b/a\t(?P<date>.*) (re)
828 @@ -1,1 +1,2 @@
828 @@ -1,1 +1,2 @@
829 a
829 a
830 +a
830 +a
831 diff -r cb9a9f314b8b b/f
831 diff -r cb9a9f314b8b b/f
832 --- /dev/null\t(?P<date>.*) (re)
832 --- /dev/null\t(?P<date>.*) (re)
833 \+\+\+ b/b/f\t(?P<date>.*) (re)
833 \+\+\+ b/b/f\t(?P<date>.*) (re)
834 @@ -0,0 +1,1 @@
834 @@ -0,0 +1,1 @@
835 +f
835 +f
836
836
837 hg qrefresh .
837 hg qrefresh .
838
838
839 $ hg qrefresh .
839 $ hg qrefresh .
840 $ cat ../.hg/patches/foo
840 $ cat ../.hg/patches/foo
841 foo
841 foo
842
842
843 diff -r cb9a9f314b8b b/f
843 diff -r cb9a9f314b8b b/f
844 --- /dev/null\t(?P<date>.*) (re)
844 --- /dev/null\t(?P<date>.*) (re)
845 \+\+\+ b/b/f\t(?P<date>.*) (re)
845 \+\+\+ b/b/f\t(?P<date>.*) (re)
846 @@ -0,0 +1,1 @@
846 @@ -0,0 +1,1 @@
847 +f
847 +f
848 $ hg status
848 $ hg status
849 M a
849 M a
850
850
851
851
852 qpush failure
852 qpush failure
853
853
854 $ cd ..
854 $ cd ..
855 $ hg qrefresh
855 $ hg qrefresh
856 $ hg qnew -mbar bar
856 $ hg qnew -mbar bar
857 $ echo foo > foo
857 $ echo foo > foo
858 $ echo bar > bar
858 $ echo bar > bar
859 $ hg add foo bar
859 $ hg add foo bar
860 $ hg qrefresh
860 $ hg qrefresh
861 $ hg qpop -a
861 $ hg qpop -a
862 popping bar
862 popping bar
863 popping foo
863 popping foo
864 patch queue now empty
864 patch queue now empty
865 $ echo bar > foo
865 $ echo bar > foo
866 $ hg qpush -a
866 $ hg qpush -a
867 applying foo
867 applying foo
868 applying bar
868 applying bar
869 file foo already exists
869 file foo already exists
870 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
870 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
871 patch failed, unable to continue (try -v)
871 patch failed, unable to continue (try -v)
872 patch failed, rejects left in working directory
872 patch failed, rejects left in working directory
873 errors during apply, please fix and qrefresh bar
873 errors during apply, please fix and qrefresh bar
874 [2]
874 [2]
875 $ hg st
875 $ hg st
876 ? foo
876 ? foo
877 ? foo.rej
877 ? foo.rej
878
878
879
879
880 mq tags
880 mq tags
881
881
882 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
882 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
883 0 qparent
883 0 qparent
884 1 foo qbase
884 1 foo qbase
885 2 bar qtip tip
885 2 bar qtip tip
886
886
887 mq revset
887 mq revset
888
888
889 $ hg log -r 'mq()' --template '{rev}\n'
889 $ hg log -r 'mq()' --template '{rev}\n'
890 1
890 1
891 2
891 2
892 $ hg help revisions.mq
892 $ hg help revisions.mq
893 "mq()"
893 "mq()"
894 Changesets managed by MQ.
894 Changesets managed by MQ.
895
895
896
896
897 bad node in status
897 bad node in status
898
898
899 $ hg qpop
899 $ hg qpop
900 popping bar
900 popping bar
901 now at: foo
901 now at: foo
902 $ hg strip -qn tip
902 $ hg strip -qn tip
903 $ hg tip
903 $ hg tip
904 changeset: 0:cb9a9f314b8b
904 changeset: 0:cb9a9f314b8b
905 tag: tip
905 tag: tip
906 user: test
906 user: test
907 date: Thu Jan 01 00:00:00 1970 +0000
907 date: Thu Jan 01 00:00:00 1970 +0000
908 summary: a
908 summary: a
909
909
910 $ hg branches
910 $ hg branches
911 default 0:cb9a9f314b8b
911 default 0:cb9a9f314b8b
912 $ hg qpop
912 $ hg qpop
913 no patches applied
913 no patches applied
914 [1]
914 [1]
915
915
916 $ cd ..
916 $ cd ..
917
917
918
918
919 git patches
919 git patches
920
920
921 $ cat >>$HGRCPATH <<EOF
921 $ cat >>$HGRCPATH <<EOF
922 > [diff]
922 > [diff]
923 > git = True
923 > git = True
924 > EOF
924 > EOF
925 $ hg init git
925 $ hg init git
926 $ cd git
926 $ cd git
927 $ hg qinit
927 $ hg qinit
928
928
929 $ hg qnew -m'new file' new
929 $ hg qnew -m'new file' new
930 $ echo foo > new
930 $ echo foo > new
931 #if execbit
931 #if execbit
932 $ chmod +x new
932 $ chmod +x new
933 #endif
933 #endif
934 $ hg add new
934 $ hg add new
935 $ hg qrefresh
935 $ hg qrefresh
936
936
937 $ cat .hg/patches/new
937 $ cat .hg/patches/new
938 new file
938 new file
939
939
940 diff --git a/new b/new
940 diff --git a/new b/new
941 new file mode 100755 (execbit !)
941 new file mode 100755 (execbit !)
942 new file mode 100644 (no-execbit !)
942 new file mode 100644 (no-execbit !)
943 --- /dev/null
943 --- /dev/null
944 +++ b/new
944 +++ b/new
945 @@ -0,0 +1,1 @@
945 @@ -0,0 +1,1 @@
946 +foo
946 +foo
947
947
948 $ hg qnew -m'copy file' copy
948 $ hg qnew -m'copy file' copy
949 $ hg cp new copy
949 $ hg cp new copy
950 $ hg qrefresh
950 $ hg qrefresh
951 $ cat .hg/patches/copy
951 $ cat .hg/patches/copy
952 copy file
952 copy file
953
953
954 diff --git a/new b/copy
954 diff --git a/new b/copy
955 copy from new
955 copy from new
956 copy to copy
956 copy to copy
957
957
958 $ hg qpop
958 $ hg qpop
959 popping copy
959 popping copy
960 now at: new
960 now at: new
961 $ hg qpush
961 $ hg qpush
962 applying copy
962 applying copy
963 now at: copy
963 now at: copy
964 $ hg qdiff
964 $ hg qdiff
965 diff --git a/new b/copy
965 diff --git a/new b/copy
966 copy from new
966 copy from new
967 copy to copy
967 copy to copy
968 $ cat >>$HGRCPATH <<EOF
968 $ cat >>$HGRCPATH <<EOF
969 > [diff]
969 > [diff]
970 > git = False
970 > git = False
971 > EOF
971 > EOF
972 $ hg qdiff --git
972 $ hg qdiff --git
973 diff --git a/new b/copy
973 diff --git a/new b/copy
974 copy from new
974 copy from new
975 copy to copy
975 copy to copy
976 $ cd ..
976 $ cd ..
977
977
978 empty lines in status
978 empty lines in status
979
979
980 $ hg init emptystatus
980 $ hg init emptystatus
981 $ cd emptystatus
981 $ cd emptystatus
982 $ hg qinit
982 $ hg qinit
983 $ printf '\n\n' > .hg/patches/status
983 $ printf '\n\n' > .hg/patches/status
984 $ hg qser
984 $ hg qser
985 $ cd ..
985 $ cd ..
986
986
987 bad line in status (without ":")
987 bad line in status (without ":")
988
988
989 $ hg init badstatus
989 $ hg init badstatus
990 $ cd badstatus
990 $ cd badstatus
991 $ hg qinit
991 $ hg qinit
992 $ printf 'babar has no colon in this line\n' > .hg/patches/status
992 $ printf 'babar has no colon in this line\n' > .hg/patches/status
993 $ hg qser
993 $ hg qser
994 malformated mq status line: ['babar has no colon in this line']
994 malformated mq status line: ['babar has no colon in this line']
995 $ cd ..
995 $ cd ..
996
996
997
997
998 test file addition in slow path
998 test file addition in slow path
999
999
1000 $ hg init slow
1000 $ hg init slow
1001 $ cd slow
1001 $ cd slow
1002 $ hg qinit
1002 $ hg qinit
1003 $ echo foo > foo
1003 $ echo foo > foo
1004 $ hg add foo
1004 $ hg add foo
1005 $ hg ci -m 'add foo'
1005 $ hg ci -m 'add foo'
1006 $ hg qnew bar
1006 $ hg qnew bar
1007 $ echo bar > bar
1007 $ echo bar > bar
1008 $ hg add bar
1008 $ hg add bar
1009 $ hg mv foo baz
1009 $ hg mv foo baz
1010 $ hg qrefresh --git
1010 $ hg qrefresh --git
1011 $ hg up -C 0
1011 $ hg up -C 0
1012 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1012 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1013 $ echo >> foo
1013 $ echo >> foo
1014 $ hg ci -m 'change foo'
1014 $ hg ci -m 'change foo'
1015 created new head
1015 created new head
1016 $ hg up -C 1
1016 $ hg up -C 1
1017 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1017 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1018 $ hg qrefresh --git
1018 $ hg qrefresh --git
1019 $ cat .hg/patches/bar
1019 $ cat .hg/patches/bar
1020 diff --git a/bar b/bar
1020 diff --git a/bar b/bar
1021 new file mode 100644
1021 new file mode 100644
1022 --- /dev/null
1022 --- /dev/null
1023 +++ b/bar
1023 +++ b/bar
1024 @@ -0,0 +1,1 @@
1024 @@ -0,0 +1,1 @@
1025 +bar
1025 +bar
1026 diff --git a/foo b/baz
1026 diff --git a/foo b/baz
1027 rename from foo
1027 rename from foo
1028 rename to baz
1028 rename to baz
1029 $ hg log -v --template '{rev} {file_copies}\n' -r .
1029 $ hg log -v --template '{rev} {file_copies}\n' -r .
1030 2 baz (foo)
1030 2 baz (foo)
1031 $ hg qrefresh --git
1031 $ hg qrefresh --git
1032 $ cat .hg/patches/bar
1032 $ cat .hg/patches/bar
1033 diff --git a/bar b/bar
1033 diff --git a/bar b/bar
1034 new file mode 100644
1034 new file mode 100644
1035 --- /dev/null
1035 --- /dev/null
1036 +++ b/bar
1036 +++ b/bar
1037 @@ -0,0 +1,1 @@
1037 @@ -0,0 +1,1 @@
1038 +bar
1038 +bar
1039 diff --git a/foo b/baz
1039 diff --git a/foo b/baz
1040 rename from foo
1040 rename from foo
1041 rename to baz
1041 rename to baz
1042 $ hg log -v --template '{rev} {file_copies}\n' -r .
1042 $ hg log -v --template '{rev} {file_copies}\n' -r .
1043 2 baz (foo)
1043 2 baz (foo)
1044 $ hg qrefresh
1044 $ hg qrefresh
1045 $ grep 'diff --git' .hg/patches/bar
1045 $ grep 'diff --git' .hg/patches/bar
1046 diff --git a/bar b/bar
1046 diff --git a/bar b/bar
1047 diff --git a/foo b/baz
1047 diff --git a/foo b/baz
1048
1048
1049
1049
1050 test file move chains in the slow path
1050 test file move chains in the slow path
1051
1051
1052 $ hg up -C 1
1052 $ hg up -C 1
1053 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1053 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1054 $ echo >> foo
1054 $ echo >> foo
1055 $ hg ci -m 'change foo again'
1055 $ hg ci -m 'change foo again'
1056 $ hg up -C 2
1056 $ hg up -C 2
1057 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1057 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1058 $ hg mv bar quux
1058 $ hg mv bar quux
1059 $ hg mv baz bleh
1059 $ hg mv baz bleh
1060 $ hg qrefresh --git
1060 $ hg qrefresh --git
1061 $ cat .hg/patches/bar
1061 $ cat .hg/patches/bar
1062 diff --git a/foo b/bleh
1062 diff --git a/foo b/bleh
1063 rename from foo
1063 rename from foo
1064 rename to bleh
1064 rename to bleh
1065 diff --git a/quux b/quux
1065 diff --git a/quux b/quux
1066 new file mode 100644
1066 new file mode 100644
1067 --- /dev/null
1067 --- /dev/null
1068 +++ b/quux
1068 +++ b/quux
1069 @@ -0,0 +1,1 @@
1069 @@ -0,0 +1,1 @@
1070 +bar
1070 +bar
1071 $ hg log -v --template '{rev} {file_copies}\n' -r .
1071 $ hg log -v --template '{rev} {file_copies}\n' -r .
1072 3 bleh (foo)
1072 3 bleh (foo)
1073 $ hg mv quux fred
1073 $ hg mv quux fred
1074 $ hg mv bleh barney
1074 $ hg mv bleh barney
1075 $ hg qrefresh --git
1075 $ hg qrefresh --git
1076 $ cat .hg/patches/bar
1076 $ cat .hg/patches/bar
1077 diff --git a/foo b/barney
1077 diff --git a/foo b/barney
1078 rename from foo
1078 rename from foo
1079 rename to barney
1079 rename to barney
1080 diff --git a/fred b/fred
1080 diff --git a/fred b/fred
1081 new file mode 100644
1081 new file mode 100644
1082 --- /dev/null
1082 --- /dev/null
1083 +++ b/fred
1083 +++ b/fred
1084 @@ -0,0 +1,1 @@
1084 @@ -0,0 +1,1 @@
1085 +bar
1085 +bar
1086 $ hg log -v --template '{rev} {file_copies}\n' -r .
1086 $ hg log -v --template '{rev} {file_copies}\n' -r .
1087 3 barney (foo)
1087 3 barney (foo)
1088
1088
1089
1089
1090 refresh omitting an added file
1090 refresh omitting an added file
1091
1091
1092 $ hg qnew baz
1092 $ hg qnew baz
1093 $ echo newfile > newfile
1093 $ echo newfile > newfile
1094 $ hg add newfile
1094 $ hg add newfile
1095 $ hg qrefresh
1095 $ hg qrefresh
1096 $ hg st -A newfile
1096 $ hg st -A newfile
1097 C newfile
1097 C newfile
1098 $ hg qrefresh -X newfile
1098 $ hg qrefresh -X newfile
1099 $ hg st -A newfile
1099 $ hg st -A newfile
1100 A newfile
1100 A newfile
1101 $ hg revert newfile
1101 $ hg revert newfile
1102 $ rm newfile
1102 $ rm newfile
1103 $ hg qpop
1103 $ hg qpop
1104 popping baz
1104 popping baz
1105 now at: bar
1105 now at: bar
1106
1106
1107 test qdel/qrm
1107 test qdel/qrm
1108
1108
1109 $ hg qdel baz
1109 $ hg qdel baz
1110 $ echo p >> .hg/patches/series
1110 $ echo p >> .hg/patches/series
1111 $ hg qrm p
1111 $ hg qrm p
1112 $ hg qser
1112 $ hg qser
1113 bar
1113 bar
1114
1114
1115 create a git patch
1115 create a git patch
1116
1116
1117 $ echo a > alexander
1117 $ echo a > alexander
1118 $ hg add alexander
1118 $ hg add alexander
1119 $ hg qnew -f --git addalexander
1119 $ hg qnew -f --git addalexander
1120 $ grep diff .hg/patches/addalexander
1120 $ grep diff .hg/patches/addalexander
1121 diff --git a/alexander b/alexander
1121 diff --git a/alexander b/alexander
1122
1122
1123
1123
1124 create a git binary patch
1124 create a git binary patch
1125
1125
1126 $ cat > writebin.py <<EOF
1126 $ cat > writebin.py <<EOF
1127 > import sys
1127 > import sys
1128 > path = sys.argv[1]
1128 > path = sys.argv[1]
1129 > open(path, 'wb').write('BIN\x00ARY')
1129 > open(path, 'wb').write(b'BIN\x00ARY')
1130 > EOF
1130 > EOF
1131 $ $PYTHON writebin.py bucephalus
1131 $ $PYTHON writebin.py bucephalus
1132
1132
1133 $ $PYTHON "$TESTDIR/md5sum.py" bucephalus
1133 $ $PYTHON "$TESTDIR/md5sum.py" bucephalus
1134 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1134 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1135 $ hg add bucephalus
1135 $ hg add bucephalus
1136 $ hg qnew -f --git addbucephalus
1136 $ hg qnew -f --git addbucephalus
1137 $ grep diff .hg/patches/addbucephalus
1137 $ grep diff .hg/patches/addbucephalus
1138 diff --git a/bucephalus b/bucephalus
1138 diff --git a/bucephalus b/bucephalus
1139
1139
1140
1140
1141 check binary patches can be popped and pushed
1141 check binary patches can be popped and pushed
1142
1142
1143 $ hg qpop
1143 $ hg qpop
1144 popping addbucephalus
1144 popping addbucephalus
1145 now at: addalexander
1145 now at: addalexander
1146 $ test -f bucephalus && echo % bucephalus should not be there
1146 $ test -f bucephalus && echo % bucephalus should not be there
1147 [1]
1147 [1]
1148 $ hg qpush
1148 $ hg qpush
1149 applying addbucephalus
1149 applying addbucephalus
1150 now at: addbucephalus
1150 now at: addbucephalus
1151 $ test -f bucephalus
1151 $ test -f bucephalus
1152 $ $PYTHON "$TESTDIR/md5sum.py" bucephalus
1152 $ $PYTHON "$TESTDIR/md5sum.py" bucephalus
1153 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1153 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1154
1154
1155
1155
1156
1156
1157 strip again
1157 strip again
1158
1158
1159 $ cd ..
1159 $ cd ..
1160 $ hg init strip
1160 $ hg init strip
1161 $ cd strip
1161 $ cd strip
1162 $ touch foo
1162 $ touch foo
1163 $ hg add foo
1163 $ hg add foo
1164 $ hg ci -m 'add foo'
1164 $ hg ci -m 'add foo'
1165 $ echo >> foo
1165 $ echo >> foo
1166 $ hg ci -m 'change foo 1'
1166 $ hg ci -m 'change foo 1'
1167 $ hg up -C 0
1167 $ hg up -C 0
1168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1169 $ echo 1 >> foo
1169 $ echo 1 >> foo
1170 $ hg ci -m 'change foo 2'
1170 $ hg ci -m 'change foo 2'
1171 created new head
1171 created new head
1172 $ HGMERGE=true hg merge
1172 $ HGMERGE=true hg merge
1173 merging foo
1173 merging foo
1174 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1174 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1175 (branch merge, don't forget to commit)
1175 (branch merge, don't forget to commit)
1176 $ hg ci -m merge
1176 $ hg ci -m merge
1177 $ hg log
1177 $ hg log
1178 changeset: 3:99615015637b
1178 changeset: 3:99615015637b
1179 tag: tip
1179 tag: tip
1180 parent: 2:20cbbe65cff7
1180 parent: 2:20cbbe65cff7
1181 parent: 1:d2871fc282d4
1181 parent: 1:d2871fc282d4
1182 user: test
1182 user: test
1183 date: Thu Jan 01 00:00:00 1970 +0000
1183 date: Thu Jan 01 00:00:00 1970 +0000
1184 summary: merge
1184 summary: merge
1185
1185
1186 changeset: 2:20cbbe65cff7
1186 changeset: 2:20cbbe65cff7
1187 parent: 0:53245c60e682
1187 parent: 0:53245c60e682
1188 user: test
1188 user: test
1189 date: Thu Jan 01 00:00:00 1970 +0000
1189 date: Thu Jan 01 00:00:00 1970 +0000
1190 summary: change foo 2
1190 summary: change foo 2
1191
1191
1192 changeset: 1:d2871fc282d4
1192 changeset: 1:d2871fc282d4
1193 user: test
1193 user: test
1194 date: Thu Jan 01 00:00:00 1970 +0000
1194 date: Thu Jan 01 00:00:00 1970 +0000
1195 summary: change foo 1
1195 summary: change foo 1
1196
1196
1197 changeset: 0:53245c60e682
1197 changeset: 0:53245c60e682
1198 user: test
1198 user: test
1199 date: Thu Jan 01 00:00:00 1970 +0000
1199 date: Thu Jan 01 00:00:00 1970 +0000
1200 summary: add foo
1200 summary: add foo
1201
1201
1202 $ hg strip 1
1202 $ hg strip 1
1203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1204 saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
1204 saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
1205 $ checkundo strip
1205 $ checkundo strip
1206 $ hg log
1206 $ hg log
1207 changeset: 1:20cbbe65cff7
1207 changeset: 1:20cbbe65cff7
1208 tag: tip
1208 tag: tip
1209 user: test
1209 user: test
1210 date: Thu Jan 01 00:00:00 1970 +0000
1210 date: Thu Jan 01 00:00:00 1970 +0000
1211 summary: change foo 2
1211 summary: change foo 2
1212
1212
1213 changeset: 0:53245c60e682
1213 changeset: 0:53245c60e682
1214 user: test
1214 user: test
1215 date: Thu Jan 01 00:00:00 1970 +0000
1215 date: Thu Jan 01 00:00:00 1970 +0000
1216 summary: add foo
1216 summary: add foo
1217
1217
1218 $ cd ..
1218 $ cd ..
1219
1219
1220
1220
1221 qclone
1221 qclone
1222
1222
1223 $ qlog()
1223 $ qlog()
1224 > {
1224 > {
1225 > echo 'main repo:'
1225 > echo 'main repo:'
1226 > hg log --template ' rev {rev}: {desc}\n'
1226 > hg log --template ' rev {rev}: {desc}\n'
1227 > echo 'patch repo:'
1227 > echo 'patch repo:'
1228 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1228 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1229 > }
1229 > }
1230 $ hg init qclonesource
1230 $ hg init qclonesource
1231 $ cd qclonesource
1231 $ cd qclonesource
1232 $ echo foo > foo
1232 $ echo foo > foo
1233 $ hg add foo
1233 $ hg add foo
1234 $ hg ci -m 'add foo'
1234 $ hg ci -m 'add foo'
1235 $ hg qinit
1235 $ hg qinit
1236 $ hg qnew patch1
1236 $ hg qnew patch1
1237 $ echo bar >> foo
1237 $ echo bar >> foo
1238 $ hg qrefresh -m 'change foo'
1238 $ hg qrefresh -m 'change foo'
1239 $ cd ..
1239 $ cd ..
1240
1240
1241
1241
1242 repo with unversioned patch dir
1242 repo with unversioned patch dir
1243
1243
1244 $ hg qclone qclonesource failure
1244 $ hg qclone qclonesource failure
1245 abort: versioned patch repository not found (see init --mq)
1245 abort: versioned patch repository not found (see init --mq)
1246 [255]
1246 [255]
1247
1247
1248 $ cd qclonesource
1248 $ cd qclonesource
1249 $ hg qinit -c
1249 $ hg qinit -c
1250 adding .hg/patches/patch1
1250 adding .hg/patches/patch1
1251 $ hg qci -m checkpoint
1251 $ hg qci -m checkpoint
1252 $ qlog
1252 $ qlog
1253 main repo:
1253 main repo:
1254 rev 1: change foo
1254 rev 1: change foo
1255 rev 0: add foo
1255 rev 0: add foo
1256 patch repo:
1256 patch repo:
1257 rev 0: checkpoint
1257 rev 0: checkpoint
1258 $ cd ..
1258 $ cd ..
1259
1259
1260
1260
1261 repo with patches applied
1261 repo with patches applied
1262
1262
1263 $ hg qclone qclonesource qclonedest
1263 $ hg qclone qclonesource qclonedest
1264 updating to branch default
1264 updating to branch default
1265 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1265 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 $ cd qclonedest
1267 $ cd qclonedest
1268 $ qlog
1268 $ qlog
1269 main repo:
1269 main repo:
1270 rev 0: add foo
1270 rev 0: add foo
1271 patch repo:
1271 patch repo:
1272 rev 0: checkpoint
1272 rev 0: checkpoint
1273 $ cd ..
1273 $ cd ..
1274
1274
1275
1275
1276 repo with patches unapplied
1276 repo with patches unapplied
1277
1277
1278 $ cd qclonesource
1278 $ cd qclonesource
1279 $ hg qpop -a
1279 $ hg qpop -a
1280 popping patch1
1280 popping patch1
1281 patch queue now empty
1281 patch queue now empty
1282 $ qlog
1282 $ qlog
1283 main repo:
1283 main repo:
1284 rev 0: add foo
1284 rev 0: add foo
1285 patch repo:
1285 patch repo:
1286 rev 0: checkpoint
1286 rev 0: checkpoint
1287 $ cd ..
1287 $ cd ..
1288 $ hg qclone qclonesource qclonedest2
1288 $ hg qclone qclonesource qclonedest2
1289 updating to branch default
1289 updating to branch default
1290 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1291 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1291 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 $ cd qclonedest2
1292 $ cd qclonedest2
1293 $ qlog
1293 $ qlog
1294 main repo:
1294 main repo:
1295 rev 0: add foo
1295 rev 0: add foo
1296 patch repo:
1296 patch repo:
1297 rev 0: checkpoint
1297 rev 0: checkpoint
1298 $ cd ..
1298 $ cd ..
1299
1299
1300
1300
1301 Issue1033: test applying on an empty file
1301 Issue1033: test applying on an empty file
1302
1302
1303 $ hg init empty
1303 $ hg init empty
1304 $ cd empty
1304 $ cd empty
1305 $ touch a
1305 $ touch a
1306 $ hg ci -Am addempty
1306 $ hg ci -Am addempty
1307 adding a
1307 adding a
1308 $ echo a > a
1308 $ echo a > a
1309 $ hg qnew -f -e changea
1309 $ hg qnew -f -e changea
1310 $ hg qpop
1310 $ hg qpop
1311 popping changea
1311 popping changea
1312 patch queue now empty
1312 patch queue now empty
1313 $ hg qpush
1313 $ hg qpush
1314 applying changea
1314 applying changea
1315 now at: changea
1315 now at: changea
1316 $ cd ..
1316 $ cd ..
1317
1317
1318 test qpush with --force, issue1087
1318 test qpush with --force, issue1087
1319
1319
1320 $ hg init forcepush
1320 $ hg init forcepush
1321 $ cd forcepush
1321 $ cd forcepush
1322 $ echo hello > hello.txt
1322 $ echo hello > hello.txt
1323 $ echo bye > bye.txt
1323 $ echo bye > bye.txt
1324 $ hg ci -Ama
1324 $ hg ci -Ama
1325 adding bye.txt
1325 adding bye.txt
1326 adding hello.txt
1326 adding hello.txt
1327 $ hg qnew -d '0 0' empty
1327 $ hg qnew -d '0 0' empty
1328 $ hg qpop
1328 $ hg qpop
1329 popping empty
1329 popping empty
1330 patch queue now empty
1330 patch queue now empty
1331 $ echo world >> hello.txt
1331 $ echo world >> hello.txt
1332
1332
1333
1333
1334 qpush should fail, local changes
1334 qpush should fail, local changes
1335
1335
1336 $ hg qpush
1336 $ hg qpush
1337 abort: local changes found
1337 abort: local changes found
1338 [255]
1338 [255]
1339
1339
1340
1340
1341 apply force, should not discard changes with empty patch
1341 apply force, should not discard changes with empty patch
1342
1342
1343 $ hg qpush -f
1343 $ hg qpush -f
1344 applying empty
1344 applying empty
1345 patch empty is empty
1345 patch empty is empty
1346 now at: empty
1346 now at: empty
1347 $ hg diff --config diff.nodates=True
1347 $ hg diff --config diff.nodates=True
1348 diff -r d58265112590 hello.txt
1348 diff -r d58265112590 hello.txt
1349 --- a/hello.txt
1349 --- a/hello.txt
1350 +++ b/hello.txt
1350 +++ b/hello.txt
1351 @@ -1,1 +1,2 @@
1351 @@ -1,1 +1,2 @@
1352 hello
1352 hello
1353 +world
1353 +world
1354 $ hg qdiff --config diff.nodates=True
1354 $ hg qdiff --config diff.nodates=True
1355 diff -r 9ecee4f634e3 hello.txt
1355 diff -r 9ecee4f634e3 hello.txt
1356 --- a/hello.txt
1356 --- a/hello.txt
1357 +++ b/hello.txt
1357 +++ b/hello.txt
1358 @@ -1,1 +1,2 @@
1358 @@ -1,1 +1,2 @@
1359 hello
1359 hello
1360 +world
1360 +world
1361 $ hg log -l1 -p
1361 $ hg log -l1 -p
1362 changeset: 1:d58265112590
1362 changeset: 1:d58265112590
1363 tag: empty
1363 tag: empty
1364 tag: qbase
1364 tag: qbase
1365 tag: qtip
1365 tag: qtip
1366 tag: tip
1366 tag: tip
1367 user: test
1367 user: test
1368 date: Thu Jan 01 00:00:00 1970 +0000
1368 date: Thu Jan 01 00:00:00 1970 +0000
1369 summary: imported patch empty
1369 summary: imported patch empty
1370
1370
1371
1371
1372 $ hg qref -d '0 0'
1372 $ hg qref -d '0 0'
1373 $ hg qpop
1373 $ hg qpop
1374 popping empty
1374 popping empty
1375 patch queue now empty
1375 patch queue now empty
1376 $ echo universe >> hello.txt
1376 $ echo universe >> hello.txt
1377 $ echo universe >> bye.txt
1377 $ echo universe >> bye.txt
1378
1378
1379
1379
1380 qpush should fail, local changes
1380 qpush should fail, local changes
1381
1381
1382 $ hg qpush
1382 $ hg qpush
1383 abort: local changes found
1383 abort: local changes found
1384 [255]
1384 [255]
1385
1385
1386
1386
1387 apply force, should discard changes in hello, but not bye
1387 apply force, should discard changes in hello, but not bye
1388
1388
1389 $ hg qpush -f --verbose --config 'ui.origbackuppath=.hg/origbackups'
1389 $ hg qpush -f --verbose --config 'ui.origbackuppath=.hg/origbackups'
1390 applying empty
1390 applying empty
1391 creating directory: $TESTTMP/forcepush/.hg/origbackups
1391 creating directory: $TESTTMP/forcepush/.hg/origbackups
1392 saving current version of hello.txt as $TESTTMP/forcepush/.hg/origbackups/hello.txt
1392 saving current version of hello.txt as $TESTTMP/forcepush/.hg/origbackups/hello.txt
1393 patching file hello.txt
1393 patching file hello.txt
1394 committing files:
1394 committing files:
1395 hello.txt
1395 hello.txt
1396 committing manifest
1396 committing manifest
1397 committing changelog
1397 committing changelog
1398 now at: empty
1398 now at: empty
1399 $ hg st
1399 $ hg st
1400 M bye.txt
1400 M bye.txt
1401 $ hg diff --config diff.nodates=True
1401 $ hg diff --config diff.nodates=True
1402 diff -r ba252371dbc1 bye.txt
1402 diff -r ba252371dbc1 bye.txt
1403 --- a/bye.txt
1403 --- a/bye.txt
1404 +++ b/bye.txt
1404 +++ b/bye.txt
1405 @@ -1,1 +1,2 @@
1405 @@ -1,1 +1,2 @@
1406 bye
1406 bye
1407 +universe
1407 +universe
1408 $ hg qdiff --config diff.nodates=True
1408 $ hg qdiff --config diff.nodates=True
1409 diff -r 9ecee4f634e3 bye.txt
1409 diff -r 9ecee4f634e3 bye.txt
1410 --- a/bye.txt
1410 --- a/bye.txt
1411 +++ b/bye.txt
1411 +++ b/bye.txt
1412 @@ -1,1 +1,2 @@
1412 @@ -1,1 +1,2 @@
1413 bye
1413 bye
1414 +universe
1414 +universe
1415 diff -r 9ecee4f634e3 hello.txt
1415 diff -r 9ecee4f634e3 hello.txt
1416 --- a/hello.txt
1416 --- a/hello.txt
1417 +++ b/hello.txt
1417 +++ b/hello.txt
1418 @@ -1,1 +1,3 @@
1418 @@ -1,1 +1,3 @@
1419 hello
1419 hello
1420 +world
1420 +world
1421 +universe
1421 +universe
1422
1422
1423 test that the previous call to qpush with -f (--force) and --config actually put
1423 test that the previous call to qpush with -f (--force) and --config actually put
1424 the orig files out of the working copy
1424 the orig files out of the working copy
1425 $ ls .hg/origbackups
1425 $ ls .hg/origbackups
1426 hello.txt
1426 hello.txt
1427
1427
1428 test popping revisions not in working dir ancestry
1428 test popping revisions not in working dir ancestry
1429
1429
1430 $ hg qseries -v
1430 $ hg qseries -v
1431 0 A empty
1431 0 A empty
1432 $ hg up qparent
1432 $ hg up qparent
1433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1434 $ hg qpop
1434 $ hg qpop
1435 popping empty
1435 popping empty
1436 patch queue now empty
1436 patch queue now empty
1437
1437
1438 $ cd ..
1438 $ cd ..
1439 $ hg init deletion-order
1439 $ hg init deletion-order
1440 $ cd deletion-order
1440 $ cd deletion-order
1441
1441
1442 $ touch a
1442 $ touch a
1443 $ hg ci -Aqm0
1443 $ hg ci -Aqm0
1444
1444
1445 $ hg qnew rename-dir
1445 $ hg qnew rename-dir
1446 $ hg rm a
1446 $ hg rm a
1447 $ hg qrefresh
1447 $ hg qrefresh
1448
1448
1449 $ mkdir a b
1449 $ mkdir a b
1450 $ touch a/a b/b
1450 $ touch a/a b/b
1451 $ hg add -q a b
1451 $ hg add -q a b
1452 $ hg qrefresh
1452 $ hg qrefresh
1453
1453
1454
1454
1455 test popping must remove files added in subdirectories first
1455 test popping must remove files added in subdirectories first
1456
1456
1457 $ hg qpop
1457 $ hg qpop
1458 popping rename-dir
1458 popping rename-dir
1459 patch queue now empty
1459 patch queue now empty
1460 $ cd ..
1460 $ cd ..
1461
1461
1462
1462
1463 test case preservation through patch pushing especially on case
1463 test case preservation through patch pushing especially on case
1464 insensitive filesystem
1464 insensitive filesystem
1465
1465
1466 $ hg init casepreserve
1466 $ hg init casepreserve
1467 $ cd casepreserve
1467 $ cd casepreserve
1468
1468
1469 $ hg qnew add-file1
1469 $ hg qnew add-file1
1470 $ echo a > TeXtFiLe.TxT
1470 $ echo a > TeXtFiLe.TxT
1471 $ hg add TeXtFiLe.TxT
1471 $ hg add TeXtFiLe.TxT
1472 $ hg qrefresh
1472 $ hg qrefresh
1473
1473
1474 $ hg qnew add-file2
1474 $ hg qnew add-file2
1475 $ echo b > AnOtHeRFiLe.TxT
1475 $ echo b > AnOtHeRFiLe.TxT
1476 $ hg add AnOtHeRFiLe.TxT
1476 $ hg add AnOtHeRFiLe.TxT
1477 $ hg qrefresh
1477 $ hg qrefresh
1478
1478
1479 $ hg qnew modify-file
1479 $ hg qnew modify-file
1480 $ echo c >> AnOtHeRFiLe.TxT
1480 $ echo c >> AnOtHeRFiLe.TxT
1481 $ hg qrefresh
1481 $ hg qrefresh
1482
1482
1483 $ hg qapplied
1483 $ hg qapplied
1484 add-file1
1484 add-file1
1485 add-file2
1485 add-file2
1486 modify-file
1486 modify-file
1487 $ hg qpop -a
1487 $ hg qpop -a
1488 popping modify-file
1488 popping modify-file
1489 popping add-file2
1489 popping add-file2
1490 popping add-file1
1490 popping add-file1
1491 patch queue now empty
1491 patch queue now empty
1492
1492
1493 this qpush causes problems below, if case preservation on case
1493 this qpush causes problems below, if case preservation on case
1494 insensitive filesystem is not enough:
1494 insensitive filesystem is not enough:
1495 (1) unexpected "adding ..." messages are shown
1495 (1) unexpected "adding ..." messages are shown
1496 (2) patching fails in modification of (1) files
1496 (2) patching fails in modification of (1) files
1497
1497
1498 $ hg qpush -a
1498 $ hg qpush -a
1499 applying add-file1
1499 applying add-file1
1500 applying add-file2
1500 applying add-file2
1501 applying modify-file
1501 applying modify-file
1502 now at: modify-file
1502 now at: modify-file
1503
1503
1504 Proper phase default with mq:
1504 Proper phase default with mq:
1505
1505
1506 1. mq.secret=false
1506 1. mq.secret=false
1507
1507
1508 $ rm .hg/store/phaseroots
1508 $ rm .hg/store/phaseroots
1509 $ hg phase 'qparent::'
1509 $ hg phase 'qparent::'
1510 -1: public
1510 -1: public
1511 0: draft
1511 0: draft
1512 1: draft
1512 1: draft
1513 2: draft
1513 2: draft
1514 $ echo '[mq]' >> $HGRCPATH
1514 $ echo '[mq]' >> $HGRCPATH
1515 $ echo 'secret=true' >> $HGRCPATH
1515 $ echo 'secret=true' >> $HGRCPATH
1516 $ rm -f .hg/store/phaseroots
1516 $ rm -f .hg/store/phaseroots
1517 $ hg phase 'qparent::'
1517 $ hg phase 'qparent::'
1518 -1: public
1518 -1: public
1519 0: secret
1519 0: secret
1520 1: secret
1520 1: secret
1521 2: secret
1521 2: secret
1522
1522
1523 Test that qfinish change phase when mq.secret=true
1523 Test that qfinish change phase when mq.secret=true
1524
1524
1525 $ hg qfinish qbase
1525 $ hg qfinish qbase
1526 patch add-file1 finalized without changeset message
1526 patch add-file1 finalized without changeset message
1527 $ hg phase 'all()'
1527 $ hg phase 'all()'
1528 0: draft
1528 0: draft
1529 1: secret
1529 1: secret
1530 2: secret
1530 2: secret
1531
1531
1532 Test that qfinish respect phases.new-commit setting
1532 Test that qfinish respect phases.new-commit setting
1533
1533
1534 $ echo '[phases]' >> $HGRCPATH
1534 $ echo '[phases]' >> $HGRCPATH
1535 $ echo 'new-commit=secret' >> $HGRCPATH
1535 $ echo 'new-commit=secret' >> $HGRCPATH
1536 $ hg qfinish qbase
1536 $ hg qfinish qbase
1537 patch add-file2 finalized without changeset message
1537 patch add-file2 finalized without changeset message
1538 $ hg phase 'all()'
1538 $ hg phase 'all()'
1539 0: draft
1539 0: draft
1540 1: secret
1540 1: secret
1541 2: secret
1541 2: secret
1542
1542
1543 (restore env for next test)
1543 (restore env for next test)
1544
1544
1545 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1545 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1546 $ cp $TESTTMP/sedtmp $HGRCPATH
1546 $ cp $TESTTMP/sedtmp $HGRCPATH
1547 $ hg qimport -r 1 --name add-file2
1547 $ hg qimport -r 1 --name add-file2
1548
1548
1549 Test that qfinish preserve phase when mq.secret=false
1549 Test that qfinish preserve phase when mq.secret=false
1550
1550
1551 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1551 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1552 $ cp $TESTTMP/sedtmp $HGRCPATH
1552 $ cp $TESTTMP/sedtmp $HGRCPATH
1553 $ hg qfinish qbase
1553 $ hg qfinish qbase
1554 patch add-file2 finalized without changeset message
1554 patch add-file2 finalized without changeset message
1555 $ hg phase 'all()'
1555 $ hg phase 'all()'
1556 0: draft
1556 0: draft
1557 1: secret
1557 1: secret
1558 2: secret
1558 2: secret
1559
1559
1560 Test that secret mq patch does not break hgweb
1560 Test that secret mq patch does not break hgweb
1561
1561
1562 $ cat > hgweb.cgi <<HGWEB
1562 $ cat > hgweb.cgi <<HGWEB
1563 > from mercurial import demandimport; demandimport.enable()
1563 > from mercurial import demandimport; demandimport.enable()
1564 > from mercurial.hgweb import hgweb
1564 > from mercurial.hgweb import hgweb
1565 > from mercurial.hgweb import wsgicgi
1565 > from mercurial.hgweb import wsgicgi
1566 > import cgitb
1566 > import cgitb
1567 > cgitb.enable()
1567 > cgitb.enable()
1568 > app = hgweb('.', 'test')
1568 > app = hgweb('.', 'test')
1569 > wsgicgi.launch(app)
1569 > wsgicgi.launch(app)
1570 > HGWEB
1570 > HGWEB
1571 $ . "$TESTDIR/cgienv"
1571 $ . "$TESTDIR/cgienv"
1572 #if msys
1572 #if msys
1573 $ PATH_INFO=//tags; export PATH_INFO
1573 $ PATH_INFO=//tags; export PATH_INFO
1574 #else
1574 #else
1575 $ PATH_INFO=/tags; export PATH_INFO
1575 $ PATH_INFO=/tags; export PATH_INFO
1576 #endif
1576 #endif
1577 $ QUERY_STRING='style=raw'
1577 $ QUERY_STRING='style=raw'
1578 $ $PYTHON hgweb.cgi | grep '^tip'
1578 $ $PYTHON hgweb.cgi | grep '^tip'
1579 tip [0-9a-f]{40} (re)
1579 tip [0-9a-f]{40} (re)
1580
1580
1581 $ cd ..
1581 $ cd ..
1582
1582
1583 Test interaction with revset (issue4426)
1583 Test interaction with revset (issue4426)
1584
1584
1585 $ hg init issue4426
1585 $ hg init issue4426
1586 $ cd issue4426
1586 $ cd issue4426
1587
1587
1588 $ echo a > a
1588 $ echo a > a
1589 $ hg ci -Am a
1589 $ hg ci -Am a
1590 adding a
1590 adding a
1591 $ echo a >> a
1591 $ echo a >> a
1592 $ hg ci -m a
1592 $ hg ci -m a
1593 $ echo a >> a
1593 $ echo a >> a
1594 $ hg ci -m a
1594 $ hg ci -m a
1595 $ hg qimport -r 0::
1595 $ hg qimport -r 0::
1596
1596
1597 reimport things
1597 reimport things
1598
1598
1599 $ hg qimport -r 1::
1599 $ hg qimport -r 1::
1600 abort: revision 2 is already managed
1600 abort: revision 2 is already managed
1601 [255]
1601 [255]
1602
1602
1603
1603
1604 $ cd ..
1604 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now