# HG changeset patch # User Pierre-Yves David # Date 1676909812 -3600 # Node ID 308aff0243aeaaa06426ebd5410ac4cc77c39001 # Parent 42288fa03322debf7a637f6bee957fb07c21a8f2 large-files: also open the context in the subdirstate diff -r 42288fa03322 -r 308aff0243ae hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Wed Feb 22 00:23:06 2023 +0100 +++ b/hgext/largefiles/overrides.py Mon Feb 20 17:16:52 2023 +0100 @@ -334,6 +334,27 @@ self._sub_dirstate = pre +@eh.wrapfunction(dirstate.dirstate, b'running_status') +@contextlib.contextmanager +def running_status(orig, self, repo): + pre = sub_dirstate = getattr(self, '_sub_dirstate', None) + try: + lfd = getattr(self, '_large_file_dirstate', False) + if sub_dirstate is None and not lfd: + sub_dirstate = lfutil.openlfdirstate(repo.ui, repo) + self._sub_dirstate = sub_dirstate + if not lfd: + assert self._sub_dirstate is not None + with orig(self, repo): + if sub_dirstate is None: + yield + else: + with sub_dirstate.running_status(repo): + yield + finally: + self._sub_dirstate = pre + + @eh.wrapfunction(subrepo.hgsubrepo, b'status') def overridestatusfn(orig, repo, rev2, **opts): with lfstatus(repo._repo):