Patchwork largefiles: overridematch() should replace the file path instead of extending (issue3934)

login
register
mail settings
Submitter elson.wei@gmail.com
Date July 24, 2013, 5:21 a.m.
Message ID <a7892246452452f57368.1374643305@ElsonWei-NB.PrimeVOLT>
Download mbox | patch
Permalink /patch/1947/
State Superseded
Commit 32e502b26983eaa89574835a024a9b035ad72bf4
Headers show

Comments

elson.wei@gmail.com - July 24, 2013, 5:21 a.m.
# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1374643244 -28800
#      Wed Jul 24 13:20:44 2013 +0800
# Branch stable
# Node ID a7892246452452f5736814e4a17a549d582ab0b2
# Parent  bf6bc468138342ebc6eb6f2f8d9519148372b18c
largefiles: overridematch() should replace the file path instead of extending (issue3934)

Patch

# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1374643244 -28800
#      Wed Jul 24 13:20:44 2013 +0800
# Branch stable
# Node ID a7892246452452f5736814e4a17a549d582ab0b2
# Parent  bf6bc468138342ebc6eb6f2f8d9519148372b18c
largefiles: overridematch() should replace the file path instead of extending (issue3934)

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -250,8 +250,10 @@ 
         """
         match = oldmatch(ctx, pats, opts, globbed, default)
         m = copy.copy(match)
-        standins = [lfutil.standin(f) for f in m._files]
-        m._files.extend(standins)
+        for i in range(0, len(m._files)):
+            standin = lfutil.standin(m._files[i])
+            if standin in repo[ctx.node()]:
+                m._files[i] = standin
         m._fmap = set(m._files)
         m._always = False
         origmatchfn = m.matchfn