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