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