largefiles: allow "lfstatus" context manager to set value to False
Differential Revision: https://phab.mercurial-scm.org/D7140
--- a/hgext/largefiles/lfutil.py Fri Oct 18 17:46:37 2019 -0700
+++ b/hgext/largefiles/lfutil.py Fri Oct 18 17:52:19 2019 -0700
@@ -41,9 +41,9 @@
@contextlib.contextmanager
-def lfstatus(repo):
+def lfstatus(repo, value=True):
oldvalue = getattr(repo, 'lfstatus', False)
- repo.lfstatus = True
+ repo.lfstatus = value
try:
yield
finally:
@@ -591,12 +591,8 @@
progress.update(i)
parents = [p for p in repo[n].parents() if p != node.nullid]
- oldlfstatus = repo.lfstatus
- repo.lfstatus = False
- try:
+ with lfstatus(repo, value=False):
ctx = repo[n]
- finally:
- repo.lfstatus = oldlfstatus
files = set(ctx.files())
if len(parents) == 2: