Show More
@@ -211,10 +211,13 b' class branchcache(dict):' | |||
|
211 | 211 | Raise KeyError for unknown branch.''' |
|
212 | 212 | return self._branchtip(self[branch])[0] |
|
213 | 213 | |
|
214 | def iteropen(self, nodes): | |
|
215 | return (n for n in nodes if n not in self._closednodes) | |
|
216 | ||
|
214 | 217 | def branchheads(self, branch, closed=False): |
|
215 | 218 | heads = self[branch] |
|
216 | 219 | if not closed: |
|
217 | heads = [h for h in heads if h not in self._closednodes] | |
|
220 | heads = list(self.iteropen(heads)) | |
|
218 | 221 | return heads |
|
219 | 222 | |
|
220 | 223 | def iterbranches(self): |
@@ -1077,7 +1077,10 b' def branches(ui, repo, active=False, clo' | |||
|
1077 | 1077 | allheads = set(repo.heads()) |
|
1078 | 1078 | branches = [] |
|
1079 | 1079 | for tag, heads, tip, isclosed in repo.branchmap().iterbranches(): |
|
1080 | isactive = not isclosed and bool(set(heads) & allheads) | |
|
1080 | isactive = False | |
|
1081 | if not isclosed: | |
|
1082 | openheads = set(repo.branchmap().iteropen(heads)) | |
|
1083 | isactive = bool(openheads & allheads) | |
|
1081 | 1084 | branches.append((tag, repo[tip], isactive, not isclosed)) |
|
1082 | 1085 | branches.sort(key=lambda i: (i[2], i[1].rev(), i[0], i[3]), |
|
1083 | 1086 | reverse=True) |
@@ -418,6 +418,131 b' branch b' | |||
|
418 | 418 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
419 | 419 | summary: prune bad branch |
|
420 | 420 | |
|
421 | ||
|
422 | reclose branch | |
|
423 | ||
|
424 | $ hg up -C c | |
|
425 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
426 | $ hg commit -d '9 0' --close-branch -m 'reclosing this branch' | |
|
427 | $ hg branches | |
|
428 | b 13:e23b5505d1ad | |
|
429 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
430 | a 5:d8cbc61dbaa6 (inactive) | |
|
431 | default 0:19709c5a4e75 (inactive) | |
|
432 | $ hg branches --closed | |
|
433 | b 13:e23b5505d1ad | |
|
434 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
435 | c 14:f894c25619d3 (closed) | |
|
436 | a 5:d8cbc61dbaa6 (inactive) | |
|
437 | default 0:19709c5a4e75 (inactive) | |
|
438 | ||
|
439 | multihead branch | |
|
440 | ||
|
441 | $ hg up -C default | |
|
442 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
|
443 | $ hg branch m | |
|
444 | marked working directory as branch m | |
|
445 | $ touch m | |
|
446 | $ hg add m | |
|
447 | $ hg commit -d '10 0' -m 'multihead base' | |
|
448 | $ echo "m1" >m | |
|
449 | $ hg commit -d '10 0' -m 'head 1' | |
|
450 | $ hg up -C '.^' | |
|
451 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
452 | $ echo "m2" >m | |
|
453 | $ hg commit -d '10 0' -m 'head 2' | |
|
454 | created new head | |
|
455 | $ hg log -b m | |
|
456 | changeset: 17:df343b0df04f | |
|
457 | branch: m | |
|
458 | tag: tip | |
|
459 | parent: 15:f3447637f53e | |
|
460 | user: test | |
|
461 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
462 | summary: head 2 | |
|
463 | ||
|
464 | changeset: 16:a58ca5d3bdf3 | |
|
465 | branch: m | |
|
466 | user: test | |
|
467 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
468 | summary: head 1 | |
|
469 | ||
|
470 | changeset: 15:f3447637f53e | |
|
471 | branch: m | |
|
472 | parent: 0:19709c5a4e75 | |
|
473 | user: test | |
|
474 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
475 | summary: multihead base | |
|
476 | ||
|
477 | $ hg heads --topo m | |
|
478 | changeset: 17:df343b0df04f | |
|
479 | branch: m | |
|
480 | tag: tip | |
|
481 | parent: 15:f3447637f53e | |
|
482 | user: test | |
|
483 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
484 | summary: head 2 | |
|
485 | ||
|
486 | changeset: 16:a58ca5d3bdf3 | |
|
487 | branch: m | |
|
488 | user: test | |
|
489 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
490 | summary: head 1 | |
|
491 | ||
|
492 | $ hg branches | |
|
493 | m 17:df343b0df04f | |
|
494 | b 13:e23b5505d1ad | |
|
495 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
496 | a 5:d8cbc61dbaa6 (inactive) | |
|
497 | default 0:19709c5a4e75 (inactive) | |
|
498 | ||
|
499 | partially merge multihead branch | |
|
500 | ||
|
501 | $ hg up -C default | |
|
502 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
503 | $ hg branch md | |
|
504 | marked working directory as branch md | |
|
505 | $ hg merge m | |
|
506 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
507 | (branch merge, don't forget to commit) | |
|
508 | $ hg commit -d '11 0' -m 'merge head 2' | |
|
509 | $ hg heads --topo m | |
|
510 | changeset: 16:a58ca5d3bdf3 | |
|
511 | branch: m | |
|
512 | user: test | |
|
513 | date: Thu Jan 01 00:00:10 1970 +0000 | |
|
514 | summary: head 1 | |
|
515 | ||
|
516 | $ hg branches | |
|
517 | md 18:c914c99f1fbb | |
|
518 | m 17:df343b0df04f | |
|
519 | b 13:e23b5505d1ad | |
|
520 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
521 | a 5:d8cbc61dbaa6 (inactive) | |
|
522 | default 0:19709c5a4e75 (inactive) | |
|
523 | ||
|
524 | partially close multihead branch | |
|
525 | ||
|
526 | $ hg up -C a58ca5d3bdf3 | |
|
527 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
528 | $ hg commit -d '12 0' -m 'close head 1' --close-branch | |
|
529 | $ hg heads --topo m | |
|
530 | changeset: 19:cd21a80baa3d | |
|
531 | branch: m | |
|
532 | tag: tip | |
|
533 | parent: 16:a58ca5d3bdf3 | |
|
534 | user: test | |
|
535 | date: Thu Jan 01 00:00:12 1970 +0000 | |
|
536 | summary: close head 1 | |
|
537 | ||
|
538 | $ hg branches | |
|
539 | md 18:c914c99f1fbb | |
|
540 | b 13:e23b5505d1ad | |
|
541 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
542 | m 17:df343b0df04f (inactive) | |
|
543 | a 5:d8cbc61dbaa6 (inactive) | |
|
544 | default 0:19709c5a4e75 (inactive) | |
|
545 | ||
|
421 | 546 | default branch colors: |
|
422 | 547 | |
|
423 | 548 | $ cat <<EOF >> $HGRCPATH |
@@ -427,22 +552,23 b' default branch colors:' | |||
|
427 | 552 | > mode = ansi |
|
428 | 553 | > EOF |
|
429 | 554 | |
|
430 | $ hg up -C c | |
|
431 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
432 | $ hg commit -d '9 0' --close-branch -m 'reclosing this branch' | |
|
433 | 555 | $ hg up -C b |
|
434 |
2 files updated, 0 files merged, |
|
|
556 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
435 | 557 | $ hg branches --color=always |
|
558 | \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc) | |
|
436 | 559 | \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc) |
|
437 | 560 | \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc) |
|
561 | \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc) | |
|
438 | 562 | \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc) |
|
439 | 563 | \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc) |
|
440 | 564 | |
|
441 | 565 | default closed branch color: |
|
442 | 566 | |
|
443 | 567 | $ hg branches --color=always --closed |
|
568 | \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc) | |
|
444 | 569 | \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc) |
|
445 | 570 | \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc) |
|
571 | \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc) | |
|
446 | 572 | \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc) |
|
447 | 573 | \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc) |
|
448 | 574 | \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc) |
@@ -461,16 +587,20 b' default closed branch color:' | |||
|
461 | 587 | custom branch colors: |
|
462 | 588 | |
|
463 | 589 | $ hg branches --color=always |
|
590 | \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc) | |
|
464 | 591 | \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc) |
|
465 | 592 | \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc) |
|
593 | \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc) | |
|
466 | 594 | \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc) |
|
467 | 595 | \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc) |
|
468 | 596 | |
|
469 | 597 | custom closed branch color: |
|
470 | 598 | |
|
471 | 599 | $ hg branches --color=always --closed |
|
600 | \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc) | |
|
472 | 601 | \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc) |
|
473 | 602 | \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc) |
|
603 | \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc) | |
|
474 | 604 | \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc) |
|
475 | 605 | \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc) |
|
476 | 606 | \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc) |
@@ -481,6 +611,14 b' template output:' | |||
|
481 | 611 | [ |
|
482 | 612 |
|
|
483 | 613 | "active": true, |
|
614 | "branch": "md", | |
|
615 | "closed": false, | |
|
616 | "current": false, | |
|
617 | "node": "c914c99f1fbb2b1d785a0a939ed3f67275df18e9", | |
|
618 | "rev": 18 | |
|
619 | }, | |
|
620 | { | |
|
621 | "active": true, | |
|
484 | 622 | "branch": "b", |
|
485 | 623 | "closed": false, |
|
486 | 624 | "current": true, |
@@ -497,6 +635,14 b' template output:' | |||
|
497 | 635 |
}, |
|
498 | 636 |
|
|
499 | 637 | "active": false, |
|
638 | "branch": "m", | |
|
639 | "closed": false, | |
|
640 | "current": false, | |
|
641 | "node": "df343b0df04feb2a946cd4b6e9520e552fef14ee", | |
|
642 | "rev": 17 | |
|
643 | }, | |
|
644 | { | |
|
645 | "active": false, | |
|
500 | 646 | "branch": "c", |
|
501 | 647 | "closed": true, |
|
502 | 648 | "current": false, |
@@ -525,8 +671,10 b' template output:' | |||
|
525 | 671 | c |
|
526 | 672 | |
|
527 | 673 |
|
|
674 | md: merge head 2 | |
|
528 | 675 | b: reopen branch with a change |
|
529 | 676 | a: Adding d branch |
|
677 | m: head 2 | |
|
530 | 678 | a: Adding b branch head 2 |
|
531 | 679 | default: Adding root node |
|
532 | 680 | |
@@ -538,8 +686,10 b' template output:' | |||
|
538 | 686 | > EOF |
|
539 | 687 | $ hg branches -T "$TESTTMP/map-myjson" |
|
540 | 688 | { |
|
689 | {"branch": "md", "node": "c914c99f1fbb"}, | |
|
541 | 690 | {"branch": "b", "node": "e23b5505d1ad"}, |
|
542 | 691 | {"branch": "a branch *", "node": "10ff5895aa57"}, (glob) |
|
692 | {"branch": "m", "node": "df343b0df04f"}, | |
|
543 | 693 |
|
|
544 | 694 |
|
|
545 | 695 |
|
@@ -553,8 +703,10 b' template output:' | |||
|
553 | 703 | > EOF |
|
554 | 704 | $ hg branches -T myjson |
|
555 | 705 |
|
|
706 | {"branch": "md", "node": "c914c99f1fbb"}, | |
|
556 | 707 |
|
|
557 | 708 |
|
|
709 | {"branch": "m", "node": "df343b0df04f"}, | |
|
558 | 710 |
|
|
559 | 711 |
|
|
560 | 712 |
|
@@ -564,8 +716,10 b' template output:' | |||
|
564 | 716 |
> |
|
565 | 717 | > EOF |
|
566 | 718 |
|
|
719 | md | |
|
567 | 720 | b |
|
568 | 721 | a branch name much longer than the default justification used by branches |
|
722 | m | |
|
569 | 723 | a |
|
570 | 724 | default |
|
571 | 725 | |
@@ -579,14 +733,14 b' revision branch cache is created when bu' | |||
|
579 | 733 |
|
|
580 | 734 | 5 |
|
581 | 735 | $ f --hexdump --size .hg/cache/rbc-* |
|
582 |
.hg/cache/rbc-names-v1: size= |
|
|
736 | .hg/cache/rbc-names-v1: size=92 | |
|
583 | 737 | 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a | |
|
584 | 738 | 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much| |
|
585 | 739 | 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the| |
|
586 | 740 | 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi| |
|
587 | 741 | 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b| |
|
588 |
0050: 72 61 6e 63 68 65 73 |
|
|
589 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
742 | 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 |ranches.m.md| | |
|
743 | .hg/cache/rbc-revs-v1: size=160 | |
|
590 | 744 | 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| |
|
591 | 745 | 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....| |
|
592 | 746 | 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................| |
@@ -594,7 +748,9 b' revision branch cache is created when bu' | |||
|
594 | 748 | 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....| |
|
595 | 749 | 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....| |
|
596 | 750 | 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....| |
|
597 |
0070: f8 94 c2 56 80 00 00 03 |
|
|
751 | 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....| | |
|
752 | 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....| | |
|
753 | 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......| | |
|
598 | 754 | |
|
599 | 755 | no errors when revbranchcache is not writable |
|
600 | 756 | |
@@ -622,9 +778,9 b' recovery from invalid cache revs file wi' | |||
|
622 | 778 | $ echo >> .hg/cache/rbc-revs-v1 |
|
623 | 779 | $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
|
624 | 780 | 5 |
|
625 |
truncating cache/rbc-revs-v1 to 1 |
|
|
781 | truncating cache/rbc-revs-v1 to 160 | |
|
626 | 782 | $ f --size .hg/cache/rbc-revs* |
|
627 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
783 | .hg/cache/rbc-revs-v1: size=160 | |
|
628 | 784 | recovery from invalid cache file with partial last record |
|
629 | 785 | $ mv .hg/cache/rbc-revs-v1 . |
|
630 | 786 | $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
@@ -634,14 +790,14 b' recovery from invalid cache file with pa' | |||
|
634 | 790 | 5 |
|
635 | 791 | truncating cache/rbc-revs-v1 to 112 |
|
636 | 792 | $ f --size .hg/cache/rbc-revs* |
|
637 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
793 | .hg/cache/rbc-revs-v1: size=160 | |
|
638 | 794 | recovery from invalid cache file with missing record - no truncation |
|
639 | 795 | $ mv .hg/cache/rbc-revs-v1 . |
|
640 | 796 | $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
|
641 | 797 | $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
|
642 | 798 | 5 |
|
643 | 799 | $ f --size .hg/cache/rbc-revs* |
|
644 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
800 | .hg/cache/rbc-revs-v1: size=160 | |
|
645 | 801 | recovery from invalid cache file with some bad records |
|
646 | 802 | $ mv .hg/cache/rbc-revs-v1 . |
|
647 | 803 | $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
@@ -658,29 +814,29 b' recovery from invalid cache file with so' | |||
|
658 | 814 | 5 |
|
659 | 815 | truncating cache/rbc-revs-v1 to 104 |
|
660 | 816 | $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs* |
|
661 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
817 | .hg/cache/rbc-revs-v1: size=160 | |
|
662 | 818 | 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| |
|
663 | 819 | cache is updated when committing |
|
664 | 820 | $ hg branch i-will-regret-this |
|
665 | 821 | marked working directory as branch i-will-regret-this |
|
666 | 822 | $ hg ci -m regrets |
|
667 | 823 | $ f --size .hg/cache/rbc-* |
|
668 |
.hg/cache/rbc-names-v1: size=1 |
|
|
669 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
824 | .hg/cache/rbc-names-v1: size=111 | |
|
825 | .hg/cache/rbc-revs-v1: size=168 | |
|
670 | 826 | update after rollback - the cache will be correct but rbc-names will will still |
|
671 | 827 | contain the branch name even though it no longer is used |
|
672 | 828 | $ hg up -qr '.^' |
|
673 | 829 | $ hg rollback -qf |
|
674 | 830 | $ f --size --hexdump .hg/cache/rbc-* |
|
675 |
.hg/cache/rbc-names-v1: size=1 |
|
|
831 | .hg/cache/rbc-names-v1: size=111 | |
|
676 | 832 | 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a | |
|
677 | 833 | 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much| |
|
678 | 834 | 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the| |
|
679 | 835 | 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi| |
|
680 | 836 | 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b| |
|
681 |
0050: 72 61 6e 63 68 65 73 00 6 |
|
|
682 |
0060: 65 67 72 65 74 2d 74 68 69 73 |
|
|
683 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
837 | 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 00 69 2d 77 |ranches.m.md.i-w| | |
|
838 | 0060: 69 6c 6c 2d 72 65 67 72 65 74 2d 74 68 69 73 |ill-regret-this| | |
|
839 | .hg/cache/rbc-revs-v1: size=160 | |
|
684 | 840 | 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| |
|
685 | 841 | 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....| |
|
686 | 842 | 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................| |
@@ -688,12 +844,14 b' contain the branch name even though it n' | |||
|
688 | 844 | 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....| |
|
689 | 845 | 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....| |
|
690 | 846 | 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....| |
|
691 |
0070: f8 94 c2 56 80 00 00 03 |
|
|
847 | 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....| | |
|
848 | 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....| | |
|
849 | 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......| | |
|
692 | 850 | cache is updated/truncated when stripping - it is thus very hard to get in a |
|
693 | 851 | situation where the cache is out of sync and the hash check detects it |
|
694 | 852 | $ hg --config extensions.strip= strip -r tip --nob |
|
695 | 853 | $ f --size .hg/cache/rbc-revs* |
|
696 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
854 | .hg/cache/rbc-revs-v1: size=152 | |
|
697 | 855 | |
|
698 | 856 | cache is rebuilt when corruption is detected |
|
699 | 857 | $ echo > .hg/cache/rbc-names-v1 |
@@ -701,13 +859,14 b' cache is rebuilt when corruption is dete' | |||
|
701 | 859 | referenced branch names not found - rebuilding revision branch cache from scratch |
|
702 | 860 | 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40 |
|
703 | 861 | $ f --size --hexdump .hg/cache/rbc-* |
|
704 |
.hg/cache/rbc-names-v1: size= |
|
|
862 | .hg/cache/rbc-names-v1: size=84 | |
|
705 | 863 | 0000: 62 00 61 00 63 00 61 20 62 72 61 6e 63 68 20 6e |b.a.c.a branch n| |
|
706 | 864 | 0010: 61 6d 65 20 6d 75 63 68 20 6c 6f 6e 67 65 72 20 |ame much longer | |
|
707 | 865 | 0020: 74 68 61 6e 20 74 68 65 20 64 65 66 61 75 6c 74 |than the default| |
|
708 | 866 | 0030: 20 6a 75 73 74 69 66 69 63 61 74 69 6f 6e 20 75 | justification u| |
|
709 |
0040: 73 65 64 20 62 79 20 62 72 61 6e 63 68 65 73 |
|
|
710 | .hg/cache/rbc-revs-v1: size=112 | |
|
867 | 0040: 73 65 64 20 62 79 20 62 72 61 6e 63 68 65 73 00 |sed by branches.| | |
|
868 | 0050: 6d 00 6d 64 |m.md| | |
|
869 | .hg/cache/rbc-revs-v1: size=152 | |
|
711 | 870 | 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
712 | 871 | 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
713 | 872 | 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 01 |................| |
@@ -715,6 +874,9 b' cache is rebuilt when corruption is dete' | |||
|
715 | 874 | 0040: ee bb 94 44 00 00 00 00 5f 40 61 bb 00 00 00 00 |...D...._@a.....| |
|
716 | 875 | 0050: bf be 84 1b 00 00 00 00 d3 f1 63 45 80 00 00 00 |..........cE....| |
|
717 | 876 | 0060: e3 d4 9c 05 80 00 00 00 e2 3b 55 05 00 00 00 00 |.........;U.....| |
|
877 | 0070: f8 94 c2 56 80 00 00 02 f3 44 76 37 00 00 00 04 |...V.....Dv7....| | |
|
878 | 0080: a5 8c a5 d3 00 00 00 04 df 34 3b 0d 00 00 00 04 |.........4;.....| | |
|
879 | 0090: c9 14 c9 9f 00 00 00 05 |........| | |
|
718 | 880 | |
|
719 | 881 | Test that cache files are created and grows correctly: |
|
720 | 882 | |
@@ -724,7 +886,7 b' Test that cache files are created and gr' | |||
|
724 | 886 | $ f --size --hexdump .hg/cache/rbc-* |
|
725 | 887 | .hg/cache/rbc-names-v1: size=1 |
|
726 | 888 | 0000: 61 |a| |
|
727 |
.hg/cache/rbc-revs-v1: size=1 |
|
|
889 | .hg/cache/rbc-revs-v1: size=152 | |
|
728 | 890 | 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
729 | 891 | 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
730 | 892 | 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 00 |................| |
@@ -732,6 +894,9 b' Test that cache files are created and gr' | |||
|
732 | 894 | 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
733 | 895 | 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
734 | 896 | 0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| |
|
897 | 0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |
|
898 | 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |
|
899 | 0090: 00 00 00 00 00 00 00 00 |........| | |
|
735 | 900 | |
|
736 | 901 | $ cd .. |
|
737 | 902 |
General Comments 0
You need to be logged in to leave comments.
Login now