hgext/largefiles/overrides.py
changeset 22173 d3702a822241
parent 22097 7d1eac06ab2b
parent 22170 0e1b02f984c7
child 22193 efc591e8b35c
--- a/hgext/largefiles/overrides.py	Thu Aug 14 15:21:48 2014 -0500
+++ b/hgext/largefiles/overrides.py	Thu Aug 14 16:25:47 2014 -0500
@@ -267,6 +267,11 @@
         matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default)
         m, p = copy.copy(matchandpats)
 
+        if m.always():
+            # We want to match everything anyway, so there's no benefit trying
+            # to add standins.
+            return matchandpats
+
         pats = set(p)
         # TODO: handling of patterns in both cases below
         if m._cwd:
@@ -299,13 +304,25 @@
 
         return m, pats
 
+    # For hg log --patch, the match object is used in two different senses:
+    # (1) to determine what revisions should be printed out, and
+    # (2) to determine what files to print out diffs for.
+    # The magic matchandpats override should be used for case (1) but not for
+    # case (2).
+    def overridemakelogfilematcher(repo, pats, opts):
+        pctx = repo[None]
+        match, pats = oldmatchandpats(pctx, pats, opts)
+        return lambda rev: match
+
     oldmatchandpats = installmatchandpatsfn(overridematchandpats)
+    oldmakelogfilematcher = cmdutil._makenofollowlogfilematcher
+    setattr(cmdutil, '_makenofollowlogfilematcher', overridemakelogfilematcher)
+
     try:
-        repo.lfstatus = True
         return orig(ui, repo, *pats, **opts)
     finally:
-        repo.lfstatus = False
         restorematchandpatsfn()
+        setattr(cmdutil, '_makenofollowlogfilematcher', oldmakelogfilematcher)
 
 def overrideverify(orig, ui, repo, *pats, **opts):
     large = opts.pop('large', False)