Show More
@@ -1059,8 +1059,14 b' def walkchangerevs(repo, match, opts, pr' | |||||
1059 | # We only have to read through the filelog to find wanted revisions |
|
1059 | # We only have to read through the filelog to find wanted revisions | |
1060 |
|
1060 | |||
1061 | minrev, maxrev = min(revs), max(revs) |
|
1061 | minrev, maxrev = min(revs), max(revs) | |
1062 | # Only files, no patterns. Check the history of each file. |
|
|||
1063 | def filerevgen(filelog, last): |
|
1062 | def filerevgen(filelog, last): | |
|
1063 | """ | |||
|
1064 | Only files, no patterns. Check the history of each file. | |||
|
1065 | ||||
|
1066 | Examines filelog entries within minrev, maxrev linkrev range | |||
|
1067 | Returns an iterator yielding (linkrev, parentlinkrevs, copied) | |||
|
1068 | tuples in backwards order | |||
|
1069 | """ | |||
1064 | cl_count = len(repo) |
|
1070 | cl_count = len(repo) | |
1065 | revs = [] |
|
1071 | revs = [] | |
1066 | for j in xrange(0, last + 1): |
|
1072 | for j in xrange(0, last + 1): | |
@@ -1071,8 +1077,13 b' def walkchangerevs(repo, match, opts, pr' | |||||
1071 | # happen while doing "hg log" during a pull or commit |
|
1077 | # happen while doing "hg log" during a pull or commit | |
1072 | if linkrev > maxrev or linkrev >= cl_count: |
|
1078 | if linkrev > maxrev or linkrev >= cl_count: | |
1073 | break |
|
1079 | break | |
|
1080 | ||||
|
1081 | parentlinkrevs = [] | |||
|
1082 | for p in filelog.parentrevs(j): | |||
|
1083 | if p != nullrev: | |||
|
1084 | parentlinkrevs.append(filelog.linkrev(p)) | |||
1074 | n = filelog.node(j) |
|
1085 | n = filelog.node(j) | |
1075 |
revs.append(( |
|
1086 | revs.append((linkrev, parentlinkrevs, | |
1076 | follow and filelog.renamed(n))) |
|
1087 | follow and filelog.renamed(n))) | |
1077 |
|
1088 | |||
1078 | for rev in reversed(revs): |
|
1089 | for rev in reversed(revs): | |
@@ -1101,7 +1112,18 b' def walkchangerevs(repo, match, opts, pr' | |||||
1101 | else: |
|
1112 | else: | |
1102 | last = filelog.rev(node) |
|
1113 | last = filelog.rev(node) | |
1103 |
|
1114 | |||
1104 | for rev, copied in filerevgen(filelog, last): |
|
1115 | ||
|
1116 | # keep track of all ancestors of the file | |||
|
1117 | ancestors = set([filelog.linkrev(last)]) | |||
|
1118 | ||||
|
1119 | # iterate from latest to oldest revision | |||
|
1120 | for rev, flparentlinkrevs, copied in filerevgen(filelog, last): | |||
|
1121 | if rev not in ancestors: | |||
|
1122 | continue | |||
|
1123 | # XXX insert 1327 fix here | |||
|
1124 | if flparentlinkrevs: | |||
|
1125 | ancestors.update(flparentlinkrevs) | |||
|
1126 | ||||
1105 | fncache.setdefault(rev, []) |
|
1127 | fncache.setdefault(rev, []) | |
1106 | fncache[rev].append(file_) |
|
1128 | fncache[rev].append(file_) | |
1107 | wanted.add(rev) |
|
1129 | wanted.add(rev) |
@@ -200,4 +200,53 b' cd dir' | |||||
200 | hg log -p -R .. ../a |
|
200 | hg log -p -R .. ../a | |
201 |
|
201 | |||
202 |
|
202 | |||
|
203 | cd .. | |||
|
204 | hg init follow2 | |||
|
205 | cd follow2 | |||
|
206 | ||||
|
207 | # Build the following history: | |||
|
208 | # tip - o - x - o - x - x | |||
|
209 | # \ / | |||
|
210 | # o - o - o - x | |||
|
211 | # \ / | |||
|
212 | # o | |||
|
213 | # | |||
|
214 | # Where "o" is a revision containing "foo" and | |||
|
215 | # "x" is a revision without "foo" | |||
|
216 | touch init | |||
|
217 | hg ci -A -m "init, unrelated" | |||
|
218 | echo 'foo' > init | |||
|
219 | hg ci -m "change, unrelated" | |||
|
220 | echo 'foo' > foo | |||
|
221 | hg ci -A -m "add unrelated old foo" | |||
|
222 | hg rm foo | |||
|
223 | hg ci -m "delete foo, unrelated" | |||
|
224 | echo 'related' > foo | |||
|
225 | hg ci -A -m "add foo, related" | |||
|
226 | ||||
|
227 | hg up 0 | |||
|
228 | touch branch | |||
|
229 | hg ci -A -m "first branch, unrelated" | |||
|
230 | touch foo | |||
|
231 | hg ci -A -m "create foo, related" | |||
|
232 | echo 'change' > foo | |||
|
233 | hg ci -m "change foo, related" | |||
|
234 | ||||
|
235 | hg up 6 | |||
|
236 | echo 'change foo in branch' > foo | |||
|
237 | hg ci -m "change foo in branch, related" | |||
|
238 | hg merge 7 | |||
|
239 | echo 'merge 1' > foo | |||
|
240 | hg resolve -m foo | |||
|
241 | hg ci -m "First merge, related" | |||
|
242 | ||||
|
243 | hg merge 4 | |||
|
244 | echo 'merge 2' > foo | |||
|
245 | hg resolve -m foo | |||
|
246 | hg ci -m "Last merge, related" | |||
|
247 | ||||
|
248 | hg --config "extensions.graphlog=" glog | |||
|
249 | ||||
|
250 | hg --traceback log -f foo | |||
|
251 | ||||
203 | exit 0 |
|
252 | exit 0 |
@@ -611,3 +611,120 b' diff -r 000000000000 -r 24427303d56f a' | |||||
611 | @@ -0,0 +1,1 @@ |
|
611 | @@ -0,0 +1,1 @@ | |
612 | +a |
|
612 | +a | |
613 |
|
613 | |||
|
614 | adding init | |||
|
615 | adding foo | |||
|
616 | adding foo | |||
|
617 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
618 | adding branch | |||
|
619 | created new head | |||
|
620 | adding foo | |||
|
621 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
622 | created new head | |||
|
623 | merging foo | |||
|
624 | warning: conflicts during merge. | |||
|
625 | merging foo failed! | |||
|
626 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |||
|
627 | use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon | |||
|
628 | merging foo | |||
|
629 | warning: conflicts during merge. | |||
|
630 | merging foo failed! | |||
|
631 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | |||
|
632 | use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon | |||
|
633 | @ changeset: 10:4dae8563d2c5 | |||
|
634 | |\ tag: tip | |||
|
635 | | | parent: 9:7b35701b003e | |||
|
636 | | | parent: 4:88176d361b69 | |||
|
637 | | | user: test | |||
|
638 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
639 | | | summary: Last merge, related | |||
|
640 | | | | |||
|
641 | | o changeset: 9:7b35701b003e | |||
|
642 | | |\ parent: 8:e5416ad8a855 | |||
|
643 | | | | parent: 7:87fe3144dcfa | |||
|
644 | | | | user: test | |||
|
645 | | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
646 | | | | summary: First merge, related | |||
|
647 | | | | | |||
|
648 | | | o changeset: 8:e5416ad8a855 | |||
|
649 | | | | parent: 6:dc6c325fe5ee | |||
|
650 | | | | user: test | |||
|
651 | | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
652 | | | | summary: change foo in branch, related | |||
|
653 | | | | | |||
|
654 | | o | changeset: 7:87fe3144dcfa | |||
|
655 | | |/ user: test | |||
|
656 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
657 | | | summary: change foo, related | |||
|
658 | | | | |||
|
659 | | o changeset: 6:dc6c325fe5ee | |||
|
660 | | | user: test | |||
|
661 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
662 | | | summary: create foo, related | |||
|
663 | | | | |||
|
664 | | o changeset: 5:73db34516eb9 | |||
|
665 | | | parent: 0:e87515fd044a | |||
|
666 | | | user: test | |||
|
667 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
668 | | | summary: first branch, unrelated | |||
|
669 | | | | |||
|
670 | o | changeset: 4:88176d361b69 | |||
|
671 | | | user: test | |||
|
672 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
673 | | | summary: add foo, related | |||
|
674 | | | | |||
|
675 | o | changeset: 3:dd78ae4afb56 | |||
|
676 | | | user: test | |||
|
677 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
678 | | | summary: delete foo, unrelated | |||
|
679 | | | | |||
|
680 | o | changeset: 2:c4c64aedf0f7 | |||
|
681 | | | user: test | |||
|
682 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
683 | | | summary: add unrelated old foo | |||
|
684 | | | | |||
|
685 | o | changeset: 1:e5faa7440653 | |||
|
686 | |/ user: test | |||
|
687 | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
688 | | summary: change, unrelated | |||
|
689 | | | |||
|
690 | o changeset: 0:e87515fd044a | |||
|
691 | user: test | |||
|
692 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
693 | summary: init, unrelated | |||
|
694 | ||||
|
695 | changeset: 10:4dae8563d2c5 | |||
|
696 | tag: tip | |||
|
697 | parent: 9:7b35701b003e | |||
|
698 | parent: 4:88176d361b69 | |||
|
699 | user: test | |||
|
700 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
701 | summary: Last merge, related | |||
|
702 | ||||
|
703 | changeset: 9:7b35701b003e | |||
|
704 | parent: 8:e5416ad8a855 | |||
|
705 | parent: 7:87fe3144dcfa | |||
|
706 | user: test | |||
|
707 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
708 | summary: First merge, related | |||
|
709 | ||||
|
710 | changeset: 8:e5416ad8a855 | |||
|
711 | parent: 6:dc6c325fe5ee | |||
|
712 | user: test | |||
|
713 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
714 | summary: change foo in branch, related | |||
|
715 | ||||
|
716 | changeset: 7:87fe3144dcfa | |||
|
717 | user: test | |||
|
718 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
719 | summary: change foo, related | |||
|
720 | ||||
|
721 | changeset: 6:dc6c325fe5ee | |||
|
722 | user: test | |||
|
723 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
724 | summary: create foo, related | |||
|
725 | ||||
|
726 | changeset: 4:88176d361b69 | |||
|
727 | user: test | |||
|
728 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
729 | summary: add foo, related | |||
|
730 |
General Comments 0
You need to be logged in to leave comments.
Login now