Patchwork D7137: largefiles: reset "lfstatus" attribute to previous value in "finally"

login
register
mail settings
Submitter phabricator
Date Oct. 19, 2019, 5:13 a.m.
Message ID <a7a269ab7a7b1e3f3475d2f6b45557c5@localhost.localdomain>
Download mbox | patch
Permalink /patch/42484/
State Not Applicable
Headers show

Comments

phabricator - Oct. 19, 2019, 5:13 a.m.
Closed by commit rHG013637f4812e: largefiles: reset &quot;lfstatus&quot; attribute to previous value in &quot;finally&quot; (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7137?vs=17346&id=17349

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7137/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7137

AFFECTED FILES
  hgext/largefiles/overrides.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -160,11 +160,12 @@ 
 
 @contextlib.contextmanager
 def lfstatus(repo):
+    oldvalue = getattr(repo, 'lfstatus', False)
     repo.lfstatus = True
     try:
         yield
     finally:
-        repo.lfstatus = False
+        repo.lfstatus = oldvalue
 
 
 def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts):