[PATCH 14 of 19] context: support matches in workingctx.status

Matt Mackall mpm at selenic.com
Tue Feb 12 23:16:25 CST 2013


On Sun, 2013-02-10 at 15:30 -0800, David Schleimer wrote:
> # HG changeset patch
> # User David Schleimer <dschleimer at fb.com>
> # Date 1360424562 28800
> # Node ID 730f81cd4b340348dfc5d2eb571f3b13e01c73e4
> # Parent  1bae6048dd1028bb6b7506ec1ecb73bd819e7449
> context: support matches in workingctx.status
> 
> This makes it possible to get a filtered view of the workingcopy via
> workingctx.status().  This is currently unused, but subsequent patches
> will use this to pull validation steps out of localrepo.commit and
> into the workingctx.  This in turn will make it practical to unify
> workingctx and memctx, making memctx more useful.

This and a few of the other patches move us further away from having
having repo[None] cacheable. That's a little unfortunate.

Perhaps we want to instead have a distinct commitctx type.

> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -941,12 +941,15 @@
>              p = p[:-1]
>          return [changectx(self._repo, x) for x in p]
>  
> -    def status(self, ignored=False, clean=False, unknown=False):
> +    def status(self, ignored=False, clean=False, unknown=False, match=None):
>          """Explicit status query
>          Unless this method is used to query the working copy status, the
>          _status property will implicitly read the status using its default
>          arguments."""
> -        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
> +        stat = self._repo.status(ignored=ignored,
> +                                 clean=clean,
> +                                 unknown=unknown,
> +                                 match=match)
>          self._unknown = self._ignored = self._clean = None
>          if unknown:
>              self._unknown = stat[4]
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list