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

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Tue May 22 08:34:35 EDT 2018


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 remove this function by mistake?
  
  > - # Prevent adding files that are outside the sparse checkout
  > - editfuncs = ['normal', 'add', 'normallookup', 'copy', 'remove', 'merge']
  
  
  
  > +        @_editfunc
  >  +        def remove(self, *args):
  >  +            return super(narrowdirstate, self).remove(*args)
  >  +
  >  +        @_editfunc
  >  +        def remove(self, *args):
  >  +            return super(narrowdirstate, self).remove(*args)
  
  s/remove/merge/ the last function in flight.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3559

To: spectral, durin42, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list