Patchwork [2,of,7] context.status: remove unused arguments from _matchstatus()

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 2, 2014, 10:13 p.m.
Message ID <3776f277e512ecdc5b2d.1414966426@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6544/
State Accepted
Commit 98f41a2f8fba80ea84891570c0486c1e5c6d25d9
Headers show

Comments

Martin von Zweigbergk - Nov. 2, 2014, 10:13 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1413094733 25200
#      Sat Oct 11 23:18:53 2014 -0700
# Branch stable
# Node ID 3776f277e512ecdc5b2da73f3f3264af3e173640
# Parent  d68ec9fdce58cb01ec349e2731cf09247b10f436
context.status: remove unused arguments from _matchstatus()
Sean Farley - Nov. 3, 2014, 6:38 p.m.
Martin von Zweigbergk writes:

> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@gmail.com>
> # Date 1413094733 25200
> #      Sat Oct 11 23:18:53 2014 -0700
> # Branch stable
> # Node ID 3776f277e512ecdc5b2da73f3f3264af3e173640
> # Parent  d68ec9fdce58cb01ec349e2731cf09247b10f436
> context.status: remove unused arguments from _matchstatus()
>
> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -85,8 +85,7 @@
>                  del mf[fn]
>          return mf
>  
> -    def _matchstatus(self, other, s, match, listignored, listclean,
> -                     listunknown):
> +    def _matchstatus(self, other, match):

The reason these are here come from the future: having a way to pass
'should I list ignored / clean / unknown files?' to new contexts
(i.e. memctx)
Martin von Zweigbergk - Nov. 3, 2014, 7 p.m.
On Mon Nov 03 2014 at 10:38:57 AM Sean Farley <sean.michael.farley@gmail.com>
wrote:

>
> Martin von Zweigbergk writes:
>
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz@gmail.com>
> > # Date 1413094733 25200
> > #      Sat Oct 11 23:18:53 2014 -0700
> > # Branch stable
> > # Node ID 3776f277e512ecdc5b2da73f3f3264af3e173640
> > # Parent  d68ec9fdce58cb01ec349e2731cf09247b10f436
> > context.status: remove unused arguments from _matchstatus()
> >
> > diff --git a/mercurial/context.py b/mercurial/context.py
> > --- a/mercurial/context.py
> > +++ b/mercurial/context.py
> > @@ -85,8 +85,7 @@
> >                  del mf[fn]
> >          return mf
> >
> > -    def _matchstatus(self, other, s, match, listignored, listclean,
> > -                     listunknown):
> > +    def _matchstatus(self, other, match):
>
> The reason these are here come from the future: having a way to pass
> 'should I list ignored / clean / unknown files?' to new contexts
> (i.e. memctx)
>

Do we know that those parameters will be useful when creating a matcher?
What might they be used for?

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -85,8 +85,7 @@ 
                 del mf[fn]
         return mf
 
-    def _matchstatus(self, other, s, match, listignored, listclean,
-                     listunknown):
+    def _matchstatus(self, other, match):
         """return match.always if match is none
 
         This internal method provides a way for child objects to override the
@@ -311,9 +310,8 @@ 
             reversed = True
             ctx1, ctx2 = ctx2, ctx1
 
+        match = ctx2._matchstatus(ctx1, match)
         r = [[], [], [], [], [], [], []]
-        match = ctx2._matchstatus(ctx1, r, match, listignored, listclean,
-                                  listunknown)
         r = ctx2._prestatus(ctx1, r, match, listignored, listclean, listunknown)
         r = ctx2._buildstatus(ctx1, r, match, listignored, listclean,
                               listunknown)
@@ -1472,8 +1470,7 @@ 
                                                      listunknown)
         return s
 
-    def _matchstatus(self, other, s, match, listignored, listclean,
-                     listunknown):
+    def _matchstatus(self, other, match):
         """override the match method with a filter for directory patterns
 
         We use inheritance to customize the match.bad method only in cases of
@@ -1484,8 +1481,7 @@ 
         just use the default match object sent to us.
         """
         superself = super(workingctx, self)
-        match = superself._matchstatus(other, s, match, listignored, listclean,
-                                       listunknown)
+        match = superself._matchstatus(other, match)
         if other != self._repo['.']:
             def bad(f, msg):
                 # 'f' may be a directory pattern from 'match.files()',