Show More
@@ -693,6 +693,10 b' class walkopts(object):' | |||||
693 | # 0: no follow, 1: follow first, 2: follow both parents |
|
693 | # 0: no follow, 1: follow first, 2: follow both parents | |
694 | follow = attr.ib(default=0) # type: int |
|
694 | follow = attr.ib(default=0) # type: int | |
695 |
|
695 | |||
|
696 | # do not attempt filelog-based traversal, which may be fast but cannot | |||
|
697 | # include revisions where files were removed | |||
|
698 | force_changelog_traversal = attr.ib(default=False) # type: bool | |||
|
699 | ||||
696 | # limit number of changes displayed; None means unlimited |
|
700 | # limit number of changes displayed; None means unlimited | |
697 | limit = attr.ib(default=None) # type: Optional[int] |
|
701 | limit = attr.ib(default=None) # type: Optional[int] | |
698 |
|
702 | |||
@@ -715,6 +719,7 b' def parseopts(ui, pats, opts):' | |||||
715 | opts=opts, |
|
719 | opts=opts, | |
716 | revspec=opts.get(b'rev', []), |
|
720 | revspec=opts.get(b'rev', []), | |
717 | follow=follow, |
|
721 | follow=follow, | |
|
722 | force_changelog_traversal=bool(opts.get(b'removed')), | |||
718 | limit=getlimit(opts), |
|
723 | limit=getlimit(opts), | |
719 | ) |
|
724 | ) | |
720 |
|
725 | |||
@@ -736,7 +741,7 b' def _makematcher(repo, revs, wopts):' | |||||
736 | wctx = repo[None] |
|
741 | wctx = repo[None] | |
737 | match, pats = scmutil.matchandpats(wctx, wopts.pats, wopts.opts) |
|
742 | match, pats = scmutil.matchandpats(wctx, wopts.pats, wopts.opts) | |
738 | slowpath = match.anypats() or ( |
|
743 | slowpath = match.anypats() or ( | |
739 |
not match.always() and wopts. |
|
744 | not match.always() and wopts.force_changelog_traversal | |
740 | ) |
|
745 | ) | |
741 | if not slowpath: |
|
746 | if not slowpath: | |
742 | if wopts.follow and wopts.revspec: |
|
747 | if wopts.follow and wopts.revspec: | |
@@ -923,6 +928,7 b' def getrevs(repo, wopts):' | |||||
923 | revs = _initialrevs(repo, wopts) |
|
928 | revs = _initialrevs(repo, wopts) | |
924 | if not revs: |
|
929 | if not revs: | |
925 | return smartset.baseset(), None |
|
930 | return smartset.baseset(), None | |
|
931 | # TODO: might want to merge slowpath with wopts.force_changelog_traversal | |||
926 | match, pats, slowpath = _makematcher(repo, revs, wopts) |
|
932 | match, pats, slowpath = _makematcher(repo, revs, wopts) | |
927 | wopts = attr.evolve(wopts, pats=pats) |
|
933 | wopts = attr.evolve(wopts, pats=pats) | |
928 |
|
934 | |||
@@ -931,6 +937,7 b' def getrevs(repo, wopts):' | |||||
931 | if slowpath or match.always(): |
|
937 | if slowpath or match.always(): | |
932 | revs = dagop.revancestors(repo, revs, followfirst=wopts.follow == 1) |
|
938 | revs = dagop.revancestors(repo, revs, followfirst=wopts.follow == 1) | |
933 | else: |
|
939 | else: | |
|
940 | assert not wopts.force_changelog_traversal | |||
934 | revs, filematcher = _fileancestors( |
|
941 | revs, filematcher = _fileancestors( | |
935 | repo, revs, match, followfirst=wopts.follow == 1 |
|
942 | repo, revs, match, followfirst=wopts.follow == 1 | |
936 | ) |
|
943 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now