diff hgext/largefiles/overrides.py @ 21087:3fb2affb023f

largefiles: make cat on standins do something cat of a standin would silently fail. The use of standins is mostly an implementation detail, but it is already a bit leaking. Being able to see the content of standins might be convenient for debugging.
author Mads Kiilerich <madski@unity3d.com>
date Sat, 27 Apr 2013 23:19:52 +0200
parents 718f56c47414
children e095626e8676
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Sun Apr 13 18:45:43 2014 +0200
+++ b/hgext/largefiles/overrides.py	Sat Apr 27 23:19:52 2013 +0200
@@ -1116,9 +1116,11 @@
     m = scmutil.match(ctx, (file1,) + pats, opts)
     origmatchfn = m.matchfn
     def lfmatchfn(f):
+        if origmatchfn(f):
+            return True
         lf = lfutil.splitstandin(f)
         if lf is None:
-            return origmatchfn(f)
+            return False
         notbad.add(lf)
         return origmatchfn(lf)
     m.matchfn = lfmatchfn
@@ -1131,7 +1133,7 @@
         fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),
                                  pathname=f)
         lf = lfutil.splitstandin(f)
-        if lf is None:
+        if lf is None or origmatchfn(f):
             # duplicating unreachable code from commands.cat
             data = ctx[f].data()
             if opts.get('decode'):