Patchwork largefiles: replace always() method, not _always field

login
register
mail settings
Submitter via Mercurial-devel
Date May 21, 2017, 6:19 a.m.
Message ID <b19069b08f4ba5622fd0.1495347596@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20785/
State Accepted
Headers show

Comments

via Mercurial-devel - May 21, 2017, 6:19 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495172862 25200
#      Thu May 18 22:47:42 2017 -0700
# Node ID b19069b08f4ba5622fd073d1f7e66fe7fb411c4e
# Parent  7fa6d9b0bf18f5ffe192c8129d8b5e77bd0f3df8
largefiles: replace always() method, not _always field

We will soon have matchers that don't have an _always field, so
largefiles needs to stop assuming that they do. _always is only used
by always(), so we safely replace that method instead.
Yuya Nishihara - May 21, 2017, 8:24 a.m.
On Sat, 20 May 2017 23:19:56 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1495172862 25200
> #      Thu May 18 22:47:42 2017 -0700
> # Node ID b19069b08f4ba5622fd073d1f7e66fe7fb411c4e
> # Parent  7fa6d9b0bf18f5ffe192c8129d8b5e77bd0f3df8
> largefiles: replace always() method, not _always field

Queued, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -42,7 +42,7 @@ 
     lfile = lambda f: lfutil.standin(f) in manifest
     m._files = filter(lfile, m._files)
     m._fileset = set(m._files)
-    m._always = False
+    m.always = lambda: False
     origmatchfn = m.matchfn
     m.matchfn = lambda f: lfile(f) and origmatchfn(f)
     return m
@@ -57,7 +57,7 @@ 
             manifest or f in excluded)
     m._files = filter(notlfile, m._files)
     m._fileset = set(m._files)
-    m._always = False
+    m.always = lambda: False
     origmatchfn = m.matchfn
     m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
     return m
@@ -369,7 +369,7 @@ 
                 m._files.append(standin)
 
         m._fileset = set(m._files)
-        m._always = False
+        m.always = lambda: False
         origmatchfn = m.matchfn
         def lfmatchfn(f):
             lf = lfutil.splitstandin(f)