Patchwork [2,of,4,V2] largefiles: fix _always for match overrides

login
register
mail settings
Submitter Siddharth Agarwal
Date March 25, 2013, 9:27 p.m.
Message ID <78c418cd493d7edb28a5.1364246825@sid0x220>
Download mbox | patch
Permalink /patch/1191/
State Accepted
Commit d780c472463c5ed767fa278a6b3d49d328d9a114
Headers show

Comments

Siddharth Agarwal - March 25, 2013, 9:27 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1364246554 25200
#      Mon Mar 25 14:22:34 2013 -0700
# Node ID 78c418cd493d7edb28a5effde76487961db813c1
# Parent  bbb2359ecbd4f129631e1840c1a1ca6ee7650baf
largefiles: fix _always for match overrides

Upcoming patches will speed dirstate.walk up by not filtering based on the
match function when match.always() is True. For that to work, match.always()
needs to be accurate. Previously it wasn't so for largefiles.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -34,6 +34,7 @@  def installnormalfilesmatchfn(manifest):
                 manifest)
         m._files = filter(notlfile, m._files)
         m._fmap = set(m._files)
+        m._always = False
         origmatchfn = m.matchfn
         m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None
         return m
@@ -251,6 +252,7 @@  def overridelog(orig, ui, repo, *pats, *
         standins = [lfutil.standin(f) for f in m._files]
         m._files.extend(standins)
         m._fmap = set(m._files)
+        m._always = False
         origmatchfn = m.matchfn
         def lfmatchfn(f):
             lf = lfutil.splitstandin(f)
@@ -519,6 +521,7 @@  def overridecopy(orig, ui, repo, pats, o
                 lfile = lambda f: lfutil.standin(f) in manifest
                 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
                 m._fmap = set(m._files)
+                m._always = False
                 origmatchfn = m.matchfn
                 m.matchfn = lambda f: (lfutil.isstandin(f) and
                                     (f in manifest) and
@@ -625,6 +628,7 @@  def overriderevert(orig, ui, repo, *pats
                 m._files = [tostandin(f) for f in m._files]
                 m._files = [f for f in m._files if f is not None]
                 m._fmap = set(m._files)
+                m._always = False
                 origmatchfn = m.matchfn
                 def matchfn(f):
                     if lfutil.isstandin(f):