comparison hgext/largefiles/overrides.py @ 43295:013637f4812e

largefiles: reset "lfstatus" attribute to previous value in "finally" We were resetting it to False, which means nesting of these overrides would be incorrect. Differential Revision: https://phab.mercurial-scm.org/D7137
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 18 Oct 2019 15:14:51 -0700
parents 03dae1044edd
children 2cb787b65cf2
comparison
equal deleted inserted replaced
43294:03dae1044edd 43295:013637f4812e
158 return added, bad 158 return added, bad
159 159
160 160
161 @contextlib.contextmanager 161 @contextlib.contextmanager
162 def lfstatus(repo): 162 def lfstatus(repo):
163 oldvalue = getattr(repo, 'lfstatus', False)
163 repo.lfstatus = True 164 repo.lfstatus = True
164 try: 165 try:
165 yield 166 yield
166 finally: 167 finally:
167 repo.lfstatus = False 168 repo.lfstatus = oldvalue
168 169
169 170
170 def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts): 171 def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts):
171 after = opts.get(r'after') 172 after = opts.get(r'after')
172 m = composelargefilematcher(matcher, repo[None].manifest()) 173 m = composelargefilematcher(matcher, repo[None].manifest())