D4606: narrow: when writing treemanifests, skip inspecting directories outside narrow

Yuya Nishihara yuya at tcha.org
Sun Sep 16 21:46:57 EDT 2018


Looks good to me. One nit.

> --- a/mercurial/manifest.py
> +++ b/mercurial/manifest.py
> @@ -1203,7 +1203,7 @@
>              s._dirty = False
>          self._loadfunc = _load_for_read
>  
> -    def writesubtrees(self, m1, m2, writesubtree):
> +    def writesubtrees(self, m1, m2, writesubtree, match=None):

Can you remove the unsupported default value `match=None` from inner functions?

> -    def add(self, m, transaction, link, p1, p2, added, removed, readtree=None):
> +    def add(self, m, transaction, link, p1, p2, added, removed, readtree=None,
> +            match=None):
>          if p1 in self.fulltextcache and util.safehasattr(m, 'fastdelta'):
>              # If our first parent is in the manifest cache, we can
>              # compute a delta here using properties we know about the
> @@ -1471,7 +1481,8 @@
>                  assert readtree, "readtree must be set for treemanifest writes"
>                  m1 = readtree(self.tree, p1)
>                  m2 = readtree(self.tree, p2)
> -                n = self._addtree(m, transaction, link, m1, m2, readtree)
> +                n = self._addtree(m, transaction, link, m1, m2, readtree,
> +                                  match=match)

Perhaps, `assert match` or `matchmod.always()` can be added.


More information about the Mercurial-devel mailing list