Show More
@@ -686,6 +686,10 b' class walkopts(object):' | |||
|
686 | 686 | pats = attr.ib() # type: List[bytes] |
|
687 | 687 | opts = attr.ib() # type: Dict[bytes, Any] |
|
688 | 688 | |
|
689 | # a list of revset expressions to be traversed; if follow, it specifies | |
|
690 | # the start revisions | |
|
691 | revspec = attr.ib() # type: List[bytes] | |
|
692 | ||
|
689 | 693 | # 0: no follow, 1: follow first, 2: follow both parents |
|
690 | 694 | follow = attr.ib(default=0) # type: int |
|
691 | 695 | |
@@ -706,7 +710,13 b' def parseopts(ui, pats, opts):' | |||
|
706 | 710 | else: |
|
707 | 711 | follow = 0 |
|
708 | 712 | |
|
709 | return walkopts(pats=pats, opts=opts, follow=follow, limit=getlimit(opts)) | |
|
713 | return walkopts( | |
|
714 | pats=pats, | |
|
715 | opts=opts, | |
|
716 | revspec=opts.get(b'rev', []), | |
|
717 | follow=follow, | |
|
718 | limit=getlimit(opts), | |
|
719 | ) | |
|
710 | 720 | |
|
711 | 721 | |
|
712 | 722 | def _makematcher(repo, revs, wopts): |
@@ -729,7 +739,7 b' def _makematcher(repo, revs, wopts):' | |||
|
729 | 739 | not match.always() and wopts.opts.get(b'removed') |
|
730 | 740 | ) |
|
731 | 741 | if not slowpath: |
|
732 |
if wopts.follow and wopts. |
|
|
742 | if wopts.follow and wopts.revspec: | |
|
733 | 743 | # There may be the case that a path doesn't exist in some (but |
|
734 | 744 | # not all) of the specified start revisions, but let's consider |
|
735 | 745 | # the path is valid. Missing files will be warned by the matcher. |
@@ -892,8 +902,8 b' def _makerevset(repo, wopts, slowpath):' | |||
|
892 | 902 | |
|
893 | 903 | def _initialrevs(repo, wopts): |
|
894 | 904 | """Return the initial set of revisions to be filtered or followed""" |
|
895 |
if wopts. |
|
|
896 |
revs = scmutil.revrange(repo, wopts. |
|
|
905 | if wopts.revspec: | |
|
906 | revs = scmutil.revrange(repo, wopts.revspec) | |
|
897 | 907 | elif wopts.follow and repo.dirstate.p1() == nullid: |
|
898 | 908 | revs = smartset.baseset() |
|
899 | 909 | elif wopts.follow: |
General Comments 0
You need to be logged in to leave comments.
Login now