hgext/largefiles/overrides.py
changeset 24133 79c2c29c71ae
parent 24029 e1dbe0b215ae
child 24163 bb11081562d7
--- a/hgext/largefiles/overrides.py	Fri Feb 06 20:39:20 2015 -0500
+++ b/hgext/largefiles/overrides.py	Sat Feb 07 19:40:02 2015 -0500
@@ -716,10 +716,17 @@
                 default='relpath'):
             match = oldmatch(ctx, pats, opts, globbed, default)
             m = copy.copy(match)
+
+            # revert supports recursing into subrepos, and though largefiles
+            # currently doesn't work correctly in that case, this match is
+            # called, so the lfdirstate above may not be the correct one for
+            # this invocation of match.
+            lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo)
+
             def tostandin(f):
                 if lfutil.standin(f) in ctx:
                     return lfutil.standin(f)
-                elif lfutil.standin(f) in repo[None]:
+                elif lfutil.standin(f) in repo[None] or lfdirstate[f] == 'r':
                     return None
                 return f
             m._files = [tostandin(f) for f in m._files]