largefiles: avoid infinite recursive call of openlfdirstate in overriderevert
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Mon, 02 Mar 2015 23:37:55 +0900
changeset 24167 90f08728e0f7
parent 24163 bb11081562d7
child 24168 4e865115566e
largefiles: avoid infinite recursive call of openlfdirstate in overriderevert When there isn't lfdirstate file in cases below, "openlfdirstate()" call "scmutil.match()" indirectly to build lfdirstate up. - subrepos disabling largefiles locally - lfdirstate file is missed accidentally This causes infinite recursive call of "openlfdirstate()" in "overriderevert()" (introduced by 79c2c29c71ae), because "openlfdirstate()" is invoked from the function overriding "scmutil.match()" itself. To avoid infinite recursive call of "openlfdirstate()" in "overriderevert()" in such cases, this patch passes "create=False" argument to "openlfdirstate()". "create=False" forcibly makes "openlfdirstate()" avoid code path to build lfdirstate up.
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Mon Mar 02 01:20:14 2015 -0600
+++ b/hgext/largefiles/overrides.py	Mon Mar 02 23:37:55 2015 +0900
@@ -721,7 +721,7 @@
             # 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)
+            lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo, False)
 
             def tostandin(f):
                 if lfutil.standin(f) in ctx: