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

Yuya Nishihara yuya at tcha.org
Tue May 22 08:32:31 EDT 2018


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.


More information about the Mercurial-devel mailing list