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

login
register
mail settings
Submitter Yuya Nishihara
Date Jan. 15, 2018, 1:26 p.m.
Message ID <79298fa195792c137194.1516022801@mimosa>
Download mbox | patch
Permalink /patch/26768/
State Accepted
Headers show

Comments

Yuya Nishihara - Jan. 15, 2018, 1:26 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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)