Patchwork largefiles: delete unnecessary meddling with matcher internals

login
register
mail settings
Submitter via Mercurial-devel
Date May 17, 2017, 9:45 p.m.
Message ID <9f5a9b36c09657e5b0c4.1495057535@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20665/
State Accepted
Headers show

Comments

via Mercurial-devel - May 17, 2017, 9:45 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495056707 25200
#      Wed May 17 14:31:47 2017 -0700
# Node ID 9f5a9b36c09657e5b0c41a07415325635656fc3a
# Parent  2d19664e257da7ad5cb97150d81838c25872fac7
largefiles: delete unnecessary meddling with matcher internals

lfutil.getstandinmatcher() was setting match._always to False because
it wanted a matcher of no patterns to match no files and match.match()
instead matches everything. However, since ba8089433090 (largefiles:
ensure lfutil.getstandinmatcher() only matches standins, 2015-08-12),
it never actually passes an empty list of patterns, so the hack has
become unnecessary.
Yuya Nishihara - May 18, 2017, 12:38 p.m.
On Wed, 17 May 2017 14:45:35 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1495056707 25200
> #      Wed May 17 14:31:47 2017 -0700
> # Node ID 9f5a9b36c09657e5b0c41a07415325635656fc3a
> # Parent  2d19664e257da7ad5cb97150d81838c25872fac7
> largefiles: delete unnecessary meddling with matcher internals

Looks good. Queued, thanks.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -296,8 +296,6 @@ 
         if not pats:
             pats = [wvfs.join(standindir)]
         match = scmutil.match(repo[None], pats, badfn=badfn)
-        # if pats is empty, it would incorrectly always match, so clear _always
-        match._always = False
     else:
         # no patterns: relative to repo root
         match = scmutil.match(repo[None], [wvfs.join(standindir)], badfn=badfn)