D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-22 Thread spectral (Kyle Lippincott)
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

D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-22 Thread yuja (Yuya Nishihara)
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

Re: D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-22 Thread Yuya Nishihara
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

D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-18 Thread spectral (Kyle Lippincott)
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

D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-16 Thread yuja (Yuya Nishihara)
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

Re: D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-16 Thread Yuya Nishihara
> -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

D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-14 Thread spectral (Kyle Lippincott)
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