# HG changeset patch # User Martin von Zweigbergk # Date 2019-10-19 00:52:19 # Node ID a02e4c12ae60b54e5b052b851cb074b2b228aa2d # Parent 73e6d3346e4f8f856a5ebdd586a8ce33fc656f63 largefiles: allow "lfstatus" context manager to set value to False Differential Revision: https://phab.mercurial-scm.org/D7140 diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -41,9 +41,9 @@ longname = b'largefiles' @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 @@ def getlfilestoupload(repo, missing, add 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: