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."""
  >  +    return _rootrepomap.get(ds._root, None)
  
  This might cause problem on long-running processes such as hgweb and
  commandserver.
  
  Instead, maybe we can extract a factory function of repo.dirstate() so that
  the narrowrepo can easily override it.
  
    class localrepository(object):
        @repofilecache('dirstate')
        def dirstate(self):
            return self._makedirstate()
    
    ...
        class narrowrepository(repo.__class__):
            def _makedirstate(self):
                d = super(...)
                return wrapdirstate(d)

REPOSITORY
  rHG Mercurial

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

To: spectral, durin42, #hg-reviewers
Cc: yuja, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to