mercurial/logcmdutil.py
changeset 45647 9fead7d97069
parent 45628 7f033a587414
child 45651 c7413ffe0402
equal deleted inserted replaced
45646:1efbc787334c 45647:9fead7d97069
   708     follow = attr.ib(default=0)  # type: int
   708     follow = attr.ib(default=0)  # type: int
   709 
   709 
   710     # do not attempt filelog-based traversal, which may be fast but cannot
   710     # do not attempt filelog-based traversal, which may be fast but cannot
   711     # include revisions where files were removed
   711     # include revisions where files were removed
   712     force_changelog_traversal = attr.ib(default=False)  # type: bool
   712     force_changelog_traversal = attr.ib(default=False)  # type: bool
       
   713 
       
   714     # filter revisions by file patterns, which should be disabled only if
       
   715     # you want to include revisions where files were unmodified
       
   716     filter_revisions_by_pats = attr.ib(default=True)  # type: bool
   713 
   717 
   714     # sort revisions prior to traversal: 'desc', 'topo', or None
   718     # sort revisions prior to traversal: 'desc', 'topo', or None
   715     sort_revisions = attr.ib(default=None)  # type: Optional[bytes]
   719     sort_revisions = attr.ib(default=None)  # type: Optional[bytes]
   716 
   720 
   717     # limit number of changes displayed; None means unlimited
   721     # limit number of changes displayed; None means unlimited
   900         b'only_merges': wopts.only_merges,
   904         b'only_merges': wopts.only_merges,
   901         b'prune': wopts.prune_ancestors,
   905         b'prune': wopts.prune_ancestors,
   902         b'user': wopts.users,
   906         b'user': wopts.users,
   903     }
   907     }
   904 
   908 
   905     if slowpath:
   909     if wopts.filter_revisions_by_pats and slowpath:
   906         # See walkchangerevs() slow path.
   910         # See walkchangerevs() slow path.
   907         #
   911         #
   908         # pats/include/exclude cannot be represented as separate
   912         # pats/include/exclude cannot be represented as separate
   909         # revset expressions as their filtering logic applies at file
   913         # revset expressions as their filtering logic applies at file
   910         # level. For instance "-I a -X b" matches a revision touching
   914         # level. For instance "-I a -X b" matches a revision touching
   917         for p in wopts.include_pats:
   921         for p in wopts.include_pats:
   918             matchargs.append(b'i:' + p)
   922             matchargs.append(b'i:' + p)
   919         for p in wopts.exclude_pats:
   923         for p in wopts.exclude_pats:
   920             matchargs.append(b'x:' + p)
   924             matchargs.append(b'x:' + p)
   921         opts[b'_matchfiles'] = matchargs
   925         opts[b'_matchfiles'] = matchargs
   922     elif not wopts.follow:
   926     elif wopts.filter_revisions_by_pats and not wopts.follow:
   923         opts[b'_patslog'] = list(wopts.pats)
   927         opts[b'_patslog'] = list(wopts.pats)
   924 
   928 
   925     expr = []
   929     expr = []
   926     for op, val in sorted(pycompat.iteritems(opts)):
   930     for op, val in sorted(pycompat.iteritems(opts)):
   927         if not val:
   931         if not val: