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 |