[PATCH 7 of 9] log: replace "not pats" with matcher attribute for consistency

Yuya Nishihara yuya at tcha.org
Mon Jan 15 08:26:41 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1515044235 -32400
#      Thu Jan 04 14:37:15 2018 +0900
# Node ID 79298fa195792c1371945e3a7161b59387ba76e1
# Parent  b78729f2f0c5b10e41985011b2f65a844d243252
log: replace "not pats" with matcher attribute for consistency

We use match.always() in _makelogrevset(). match.always() is identical to
"not pats" here since scmutil.matchandpats() empties pats in that case.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2535,7 +2535,7 @@ def getlogrevs(repo, pats, opts):
         return smartset.baseset(), None
     match, pats, slowpath = _makelogmatcher(repo, revs, pats, opts)
     if follow:
-        if slowpath or not pats:
+        if slowpath or match.always():
             revs = dagop.revancestors(repo, revs, followfirst=followfirst)
         else:
             revs = _fileancestors(repo, revs, match, followfirst)


More information about the Mercurial-devel mailing list