diff hgext/largefiles/overrides.py @ 24438:5b85a5bc5bbb

revert: evaluate filesets against working directory (issue4497) As the failing revert tests in test-fileset-generated.t show, Revert currently creates one matcher for matching files in the working copy and another matcher for matching files in the target revision. The two matchers are created with different contexts, which means filesets are evaluated differently. Then the union of the sets of files matching the matchers in the two contexts are reverted. It doesn't seem to make sense to use two different matchers; only the context they're applied to should be different. It seems very likely that the user wants the filesets to be evaluated against the working directory, which the tests test-fileset-generated.t also assume, so let's make it so. I willingly admit that the largefiles code was modified by trial and error (according to tests).
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 23 Mar 2015 23:04:51 -0700
parents 2703eb73a3af
children 1bf71faf042e
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Tue Mar 24 10:27:56 2015 -0700
+++ b/hgext/largefiles/overrides.py	Mon Mar 23 23:04:51 2015 -0700
@@ -765,7 +765,7 @@
 
             def tostandin(f):
                 standin = lfutil.standin(f)
-                if standin in mctx:
+                if standin in ctx or standin in mctx:
                     return standin
                 elif standin in repo[None] or lfdirstate[f] == 'r':
                     return None
@@ -777,7 +777,7 @@
             def matchfn(f):
                 if lfutil.isstandin(f):
                     return (origmatchfn(lfutil.splitstandin(f)) and
-                            (f in repo[None] or f in mctx))
+                            (f in ctx or f in mctx))
                 return origmatchfn(f)
             m.matchfn = matchfn
             return m