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