Mercurial > hg
comparison hgext/largefiles/overrides.py @ 50142:308aff0243ae
large-files: also open the context in the subdirstate
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 20 Feb 2023 17:16:52 +0100 |
parents | 42288fa03322 |
children | bf92386f76fd |
comparison
equal
deleted
inserted
replaced
50141:42288fa03322 | 50142:308aff0243ae |
---|---|
327 with orig(self, repo, change_type): | 327 with orig(self, repo, change_type): |
328 if sub_dirstate is None: | 328 if sub_dirstate is None: |
329 yield | 329 yield |
330 else: | 330 else: |
331 with sub_dirstate._changing(repo, change_type): | 331 with sub_dirstate._changing(repo, change_type): |
332 yield | |
333 finally: | |
334 self._sub_dirstate = pre | |
335 | |
336 | |
337 @eh.wrapfunction(dirstate.dirstate, b'running_status') | |
338 @contextlib.contextmanager | |
339 def running_status(orig, self, repo): | |
340 pre = sub_dirstate = getattr(self, '_sub_dirstate', None) | |
341 try: | |
342 lfd = getattr(self, '_large_file_dirstate', False) | |
343 if sub_dirstate is None and not lfd: | |
344 sub_dirstate = lfutil.openlfdirstate(repo.ui, repo) | |
345 self._sub_dirstate = sub_dirstate | |
346 if not lfd: | |
347 assert self._sub_dirstate is not None | |
348 with orig(self, repo): | |
349 if sub_dirstate is None: | |
350 yield | |
351 else: | |
352 with sub_dirstate.running_status(repo): | |
332 yield | 353 yield |
333 finally: | 354 finally: |
334 self._sub_dirstate = pre | 355 self._sub_dirstate = pre |
335 | 356 |
336 | 357 |