##// END OF EJS Templates
log: pass around --rev option by walkopts
Yuya Nishihara -
r46142:9a26fea2 default
parent child Browse files
Show More
@@ -686,6 +686,10 b' class walkopts(object):'
686 pats = attr.ib() # type: List[bytes]
686 pats = attr.ib() # type: List[bytes]
687 opts = attr.ib() # type: Dict[bytes, Any]
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 # 0: no follow, 1: follow first, 2: follow both parents
693 # 0: no follow, 1: follow first, 2: follow both parents
690 follow = attr.ib(default=0) # type: int
694 follow = attr.ib(default=0) # type: int
691
695
@@ -706,7 +710,13 b' def parseopts(ui, pats, opts):'
706 else:
710 else:
707 follow = 0
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 def _makematcher(repo, revs, wopts):
722 def _makematcher(repo, revs, wopts):
@@ -729,7 +739,7 b' def _makematcher(repo, revs, wopts):'
729 not match.always() and wopts.opts.get(b'removed')
739 not match.always() and wopts.opts.get(b'removed')
730 )
740 )
731 if not slowpath:
741 if not slowpath:
732 if wopts.follow and wopts.opts.get(b'rev'):
742 if wopts.follow and wopts.revspec:
733 # There may be the case that a path doesn't exist in some (but
743 # There may be the case that a path doesn't exist in some (but
734 # not all) of the specified start revisions, but let's consider
744 # not all) of the specified start revisions, but let's consider
735 # the path is valid. Missing files will be warned by the matcher.
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 def _initialrevs(repo, wopts):
903 def _initialrevs(repo, wopts):
894 """Return the initial set of revisions to be filtered or followed"""
904 """Return the initial set of revisions to be filtered or followed"""
895 if wopts.opts.get(b'rev'):
905 if wopts.revspec:
896 revs = scmutil.revrange(repo, wopts.opts[b'rev'])
906 revs = scmutil.revrange(repo, wopts.revspec)
897 elif wopts.follow and repo.dirstate.p1() == nullid:
907 elif wopts.follow and repo.dirstate.p1() == nullid:
898 revs = smartset.baseset()
908 revs = smartset.baseset()
899 elif wopts.follow:
909 elif wopts.follow:
General Comments 0
You need to be logged in to leave comments. Login now