##// END OF EJS Templates
branches: correctly show inactive multiheaded branches...
the31k -
r34076:abf91c4f default
parent child Browse files
Show More
@@ -211,10 +211,13 b' class branchcache(dict):'
211 Raise KeyError for unknown branch.'''
211 Raise KeyError for unknown branch.'''
212 return self._branchtip(self[branch])[0]
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 def branchheads(self, branch, closed=False):
217 def branchheads(self, branch, closed=False):
215 heads = self[branch]
218 heads = self[branch]
216 if not closed:
219 if not closed:
217 heads = [h for h in heads if h not in self._closednodes]
220 heads = list(self.iteropen(heads))
218 return heads
221 return heads
219
222
220 def iterbranches(self):
223 def iterbranches(self):
@@ -1077,7 +1077,10 b' def branches(ui, repo, active=False, clo'
1077 allheads = set(repo.heads())
1077 allheads = set(repo.heads())
1078 branches = []
1078 branches = []
1079 for tag, heads, tip, isclosed in repo.branchmap().iterbranches():
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 branches.append((tag, repo[tip], isactive, not isclosed))
1084 branches.append((tag, repo[tip], isactive, not isclosed))
1082 branches.sort(key=lambda i: (i[2], i[1].rev(), i[0], i[3]),
1085 branches.sort(key=lambda i: (i[2], i[1].rev(), i[0], i[3]),
1083 reverse=True)
1086 reverse=True)
@@ -418,6 +418,131 b' branch b'
418 date: Thu Jan 01 00:00:09 1970 +0000
418 date: Thu Jan 01 00:00:09 1970 +0000
419 summary: prune bad branch
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 default branch colors:
546 default branch colors:
422
547
423 $ cat <<EOF >> $HGRCPATH
548 $ cat <<EOF >> $HGRCPATH
@@ -427,22 +552,23 b' default branch colors:'
427 > mode = ansi
552 > mode = ansi
428 > EOF
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 $ hg up -C b
555 $ hg up -C b
434 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
556 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
435 $ hg branches --color=always
557 $ hg branches --color=always
558 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
436 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
559 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
437 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
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 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
562 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
439 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
563 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
440
564
441 default closed branch color:
565 default closed branch color:
442
566
443 $ hg branches --color=always --closed
567 $ hg branches --color=always --closed
568 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
444 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
569 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
445 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
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 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
572 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
447 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
573 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
448 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
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 custom branch colors:
587 custom branch colors:
462
588
463 $ hg branches --color=always
589 $ hg branches --color=always
590 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
464 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
591 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
465 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
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 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
594 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
467 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
595 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
468
596
469 custom closed branch color:
597 custom closed branch color:
470
598
471 $ hg branches --color=always --closed
599 $ hg branches --color=always --closed
600 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
472 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
601 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
473 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
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 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
604 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
475 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
605 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
476 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
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 "active": true,
613 "active": true,
614 "branch": "md",
615 "closed": false,
616 "current": false,
617 "node": "c914c99f1fbb2b1d785a0a939ed3f67275df18e9",
618 "rev": 18
619 },
620 {
621 "active": true,
484 "branch": "b",
622 "branch": "b",
485 "closed": false,
623 "closed": false,
486 "current": true,
624 "current": true,
@@ -497,6 +635,14 b' template output:'
497 },
635 },
498 {
636 {
499 "active": false,
637 "active": false,
638 "branch": "m",
639 "closed": false,
640 "current": false,
641 "node": "df343b0df04feb2a946cd4b6e9520e552fef14ee",
642 "rev": 17
643 },
644 {
645 "active": false,
500 "branch": "c",
646 "branch": "c",
501 "closed": true,
647 "closed": true,
502 "current": false,
648 "current": false,
@@ -525,8 +671,10 b' template output:'
525 c
671 c
526
672
527 $ hg branches -T '{word(0, branch)}: {desc|firstline}\n'
673 $ hg branches -T '{word(0, branch)}: {desc|firstline}\n'
674 md: merge head 2
528 b: reopen branch with a change
675 b: reopen branch with a change
529 a: Adding d branch
676 a: Adding d branch
677 m: head 2
530 a: Adding b branch head 2
678 a: Adding b branch head 2
531 default: Adding root node
679 default: Adding root node
532
680
@@ -538,8 +686,10 b' template output:'
538 > EOF
686 > EOF
539 $ hg branches -T "$TESTTMP/map-myjson"
687 $ hg branches -T "$TESTTMP/map-myjson"
540 {
688 {
689 {"branch": "md", "node": "c914c99f1fbb"},
541 {"branch": "b", "node": "e23b5505d1ad"},
690 {"branch": "b", "node": "e23b5505d1ad"},
542 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
691 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
692 {"branch": "m", "node": "df343b0df04f"},
543 {"branch": "a", "node": "d8cbc61dbaa6"},
693 {"branch": "a", "node": "d8cbc61dbaa6"},
544 {"branch": "default", "node": "19709c5a4e75"}
694 {"branch": "default", "node": "19709c5a4e75"}
545 }
695 }
@@ -553,8 +703,10 b' template output:'
553 > EOF
703 > EOF
554 $ hg branches -T myjson
704 $ hg branches -T myjson
555 {
705 {
706 {"branch": "md", "node": "c914c99f1fbb"},
556 {"branch": "b", "node": "e23b5505d1ad"},
707 {"branch": "b", "node": "e23b5505d1ad"},
557 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
708 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
709 {"branch": "m", "node": "df343b0df04f"},
558 {"branch": "a", "node": "d8cbc61dbaa6"},
710 {"branch": "a", "node": "d8cbc61dbaa6"},
559 {"branch": "default", "node": "19709c5a4e75"}
711 {"branch": "default", "node": "19709c5a4e75"}
560 }
712 }
@@ -564,8 +716,10 b' template output:'
564 > :docheader = 'should not be selected as a docheader for literal templates\n'
716 > :docheader = 'should not be selected as a docheader for literal templates\n'
565 > EOF
717 > EOF
566 $ hg branches -T '{branch}\n'
718 $ hg branches -T '{branch}\n'
719 md
567 b
720 b
568 a branch name much longer than the default justification used by branches
721 a branch name much longer than the default justification used by branches
722 m
569 a
723 a
570 default
724 default
571
725
@@ -579,14 +733,14 b' revision branch cache is created when bu'
579 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
733 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
580 5
734 5
581 $ f --hexdump --size .hg/cache/rbc-*
735 $ f --hexdump --size .hg/cache/rbc-*
582 .hg/cache/rbc-names-v1: size=87
736 .hg/cache/rbc-names-v1: size=92
583 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
737 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
584 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
738 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
585 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
739 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
586 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
740 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
587 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
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 |ranches|
742 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 |ranches.m.md|
589 .hg/cache/rbc-revs-v1: size=120
743 .hg/cache/rbc-revs-v1: size=160
590 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
744 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
591 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
745 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
592 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
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 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
748 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
595 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
749 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
596 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
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 |...V....|
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 no errors when revbranchcache is not writable
755 no errors when revbranchcache is not writable
600
756
@@ -622,9 +778,9 b' recovery from invalid cache revs file wi'
622 $ echo >> .hg/cache/rbc-revs-v1
778 $ echo >> .hg/cache/rbc-revs-v1
623 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
779 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
624 5
780 5
625 truncating cache/rbc-revs-v1 to 120
781 truncating cache/rbc-revs-v1 to 160
626 $ f --size .hg/cache/rbc-revs*
782 $ f --size .hg/cache/rbc-revs*
627 .hg/cache/rbc-revs-v1: size=120
783 .hg/cache/rbc-revs-v1: size=160
628 recovery from invalid cache file with partial last record
784 recovery from invalid cache file with partial last record
629 $ mv .hg/cache/rbc-revs-v1 .
785 $ mv .hg/cache/rbc-revs-v1 .
630 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1
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 5
790 5
635 truncating cache/rbc-revs-v1 to 112
791 truncating cache/rbc-revs-v1 to 112
636 $ f --size .hg/cache/rbc-revs*
792 $ f --size .hg/cache/rbc-revs*
637 .hg/cache/rbc-revs-v1: size=120
793 .hg/cache/rbc-revs-v1: size=160
638 recovery from invalid cache file with missing record - no truncation
794 recovery from invalid cache file with missing record - no truncation
639 $ mv .hg/cache/rbc-revs-v1 .
795 $ mv .hg/cache/rbc-revs-v1 .
640 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
796 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
641 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
797 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
642 5
798 5
643 $ f --size .hg/cache/rbc-revs*
799 $ f --size .hg/cache/rbc-revs*
644 .hg/cache/rbc-revs-v1: size=120
800 .hg/cache/rbc-revs-v1: size=160
645 recovery from invalid cache file with some bad records
801 recovery from invalid cache file with some bad records
646 $ mv .hg/cache/rbc-revs-v1 .
802 $ mv .hg/cache/rbc-revs-v1 .
647 $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1
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 5
814 5
659 truncating cache/rbc-revs-v1 to 104
815 truncating cache/rbc-revs-v1 to 104
660 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
816 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
661 .hg/cache/rbc-revs-v1: size=120
817 .hg/cache/rbc-revs-v1: size=160
662 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
818 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
663 cache is updated when committing
819 cache is updated when committing
664 $ hg branch i-will-regret-this
820 $ hg branch i-will-regret-this
665 marked working directory as branch i-will-regret-this
821 marked working directory as branch i-will-regret-this
666 $ hg ci -m regrets
822 $ hg ci -m regrets
667 $ f --size .hg/cache/rbc-*
823 $ f --size .hg/cache/rbc-*
668 .hg/cache/rbc-names-v1: size=106
824 .hg/cache/rbc-names-v1: size=111
669 .hg/cache/rbc-revs-v1: size=128
825 .hg/cache/rbc-revs-v1: size=168
670 update after rollback - the cache will be correct but rbc-names will will still
826 update after rollback - the cache will be correct but rbc-names will will still
671 contain the branch name even though it no longer is used
827 contain the branch name even though it no longer is used
672 $ hg up -qr '.^'
828 $ hg up -qr '.^'
673 $ hg rollback -qf
829 $ hg rollback -qf
674 $ f --size --hexdump .hg/cache/rbc-*
830 $ f --size --hexdump .hg/cache/rbc-*
675 .hg/cache/rbc-names-v1: size=106
831 .hg/cache/rbc-names-v1: size=111
676 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
832 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
677 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
833 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
678 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
834 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
679 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
835 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
680 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
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 69 2d 77 69 6c 6c 2d 72 |ranches.i-will-r|
837 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 00 69 2d 77 |ranches.m.md.i-w|
682 0060: 65 67 72 65 74 2d 74 68 69 73 |egret-this|
838 0060: 69 6c 6c 2d 72 65 67 72 65 74 2d 74 68 69 73 |ill-regret-this|
683 .hg/cache/rbc-revs-v1: size=120
839 .hg/cache/rbc-revs-v1: size=160
684 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
840 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
685 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
841 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
686 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
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 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
844 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
689 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
845 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
690 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
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 |...V....|
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 cache is updated/truncated when stripping - it is thus very hard to get in a
850 cache is updated/truncated when stripping - it is thus very hard to get in a
693 situation where the cache is out of sync and the hash check detects it
851 situation where the cache is out of sync and the hash check detects it
694 $ hg --config extensions.strip= strip -r tip --nob
852 $ hg --config extensions.strip= strip -r tip --nob
695 $ f --size .hg/cache/rbc-revs*
853 $ f --size .hg/cache/rbc-revs*
696 .hg/cache/rbc-revs-v1: size=112
854 .hg/cache/rbc-revs-v1: size=152
697
855
698 cache is rebuilt when corruption is detected
856 cache is rebuilt when corruption is detected
699 $ echo > .hg/cache/rbc-names-v1
857 $ echo > .hg/cache/rbc-names-v1
@@ -701,13 +859,14 b' cache is rebuilt when corruption is dete'
701 referenced branch names not found - rebuilding revision branch cache from scratch
859 referenced branch names not found - rebuilding revision branch cache from scratch
702 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40
860 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40
703 $ f --size --hexdump .hg/cache/rbc-*
861 $ f --size --hexdump .hg/cache/rbc-*
704 .hg/cache/rbc-names-v1: size=79
862 .hg/cache/rbc-names-v1: size=84
705 0000: 62 00 61 00 63 00 61 20 62 72 61 6e 63 68 20 6e |b.a.c.a branch n|
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 0010: 61 6d 65 20 6d 75 63 68 20 6c 6f 6e 67 65 72 20 |ame much longer |
864 0010: 61 6d 65 20 6d 75 63 68 20 6c 6f 6e 67 65 72 20 |ame much longer |
707 0020: 74 68 61 6e 20 74 68 65 20 64 65 66 61 75 6c 74 |than the default|
865 0020: 74 68 61 6e 20 74 68 65 20 64 65 66 61 75 6c 74 |than the default|
708 0030: 20 6a 75 73 74 69 66 69 63 61 74 69 6f 6e 20 75 | justification u|
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 |sed by branches|
867 0040: 73 65 64 20 62 79 20 62 72 61 6e 63 68 65 73 00 |sed by branches.|
710 .hg/cache/rbc-revs-v1: size=112
868 0050: 6d 00 6d 64 |m.md|
869 .hg/cache/rbc-revs-v1: size=152
711 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
870 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
712 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
871 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
713 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 01 |................|
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 0040: ee bb 94 44 00 00 00 00 5f 40 61 bb 00 00 00 00 |...D...._@a.....|
874 0040: ee bb 94 44 00 00 00 00 5f 40 61 bb 00 00 00 00 |...D...._@a.....|
716 0050: bf be 84 1b 00 00 00 00 d3 f1 63 45 80 00 00 00 |..........cE....|
875 0050: bf be 84 1b 00 00 00 00 d3 f1 63 45 80 00 00 00 |..........cE....|
717 0060: e3 d4 9c 05 80 00 00 00 e2 3b 55 05 00 00 00 00 |.........;U.....|
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 Test that cache files are created and grows correctly:
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 $ f --size --hexdump .hg/cache/rbc-*
886 $ f --size --hexdump .hg/cache/rbc-*
725 .hg/cache/rbc-names-v1: size=1
887 .hg/cache/rbc-names-v1: size=1
726 0000: 61 |a|
888 0000: 61 |a|
727 .hg/cache/rbc-revs-v1: size=112
889 .hg/cache/rbc-revs-v1: size=152
728 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
890 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
729 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
891 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
730 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 00 |................|
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 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
894 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
733 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
895 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
734 0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
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 $ cd ..
901 $ cd ..
737
902
General Comments 0
You need to be logged in to leave comments. Login now