This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1cba497491be: narrow: only wrap dirstate functions once,
instead of per-reposetup (authored by spectral, committed by ).
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D3559?vs=8744&id=8871#toc
yuja added a comment.
Queued, thanks.
> - a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -778,6 +778,9 @@
>
> @repofilecache('dirstate') def dirstate(self): +return
self._makedirstate() + +def _makedirstate(self):
Can you add a docstring so we wouldn't re
Queued, thanks.
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -778,6 +778,9 @@
>
> @repofilecache('dirstate')
> def dirstate(self):
> +return self._makedirstate()
> +
> +def _makedirstate(self):
Can you add a docstring so we wouldn't remove this functi
spectral updated this revision to Diff 8744.
spectral edited the summary of this revision.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3559?vs=8682&id=8744
REVISION DETAIL
https://phab.mercurial-scm.org/D3559
AFFECTED FILES
hgext/narrow/__init__.py
yuja added a comment.
> -def setup(repo):
> +# Mapping of root:str to repo for repos that have the narrow requirement
> +# specified.
> +_rootrepomap = {}
> +
> +def _getrepo(ds):
> +"""Check if narrow is enabled for repo associated with `ds`; return
repo."""
> +re
> -def setup(repo):
> +# Mapping of root:str to repo for repos that have the narrow requirement
> +# specified.
> +_rootrepomap = {}
> +
> +def _getrepo(ds):
> +"""Check if narrow is enabled for repo associated with `ds`; return
> repo."""
> +return _rootrepomap.get(ds._root, None)
This m
spectral created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
chg will call reposetup multiple times, and we will end up double-wrapping (or
worse) the dirstate functions; this can cause iss