Patchwork [4,of,4,STABLE] context.status: remove overriding in workingctx

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 23, 2014, 9:39 p.m.
Message ID <47d1e211f68485ad2070.1414100388@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6457/
State Superseded
Commit 7ea2ef4479f218632e899411a771bd05aa033432
Headers show

Comments

Martin von Zweigbergk - Oct. 23, 2014, 9:39 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1414097000 25200
#      Thu Oct 23 13:43:20 2014 -0700
# Branch stable
# Node ID 47d1e211f68485ad2070fb505966edf34178a564
# Parent  2eb04f88de4b5103fb3c3584811b557b3ec2b771
context.status: remove overriding in workingctx

The workingctx method simply calls the super method. The only effect
it has is that it uses a different default argument for the 'other'
argument. The only in-tree caller is patch.diff, which always passes
an argument to the method, so it should be safe to remove the
overriding. Having the default argument depend on the type seems
rather dangerous anyway.
Matt Mackall - Oct. 24, 2014, 8:51 p.m.
On Thu, 2014-10-23 at 14:39 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1414097000 25200
> #      Thu Oct 23 13:43:20 2014 -0700
> # Branch stable
> # Node ID 47d1e211f68485ad2070fb505966edf34178a564
> # Parent  2eb04f88de4b5103fb3c3584811b557b3ec2b771
> context.status: remove overriding in workingctx
> 
> The workingctx method simply calls the super method. The only effect
> it has is that it uses a different default argument for the 'other'
> argument. The only in-tree caller is patch.diff, which always passes
> an argument to the method, so it should be safe to remove the
> overriding. Having the default argument depend on the type seems
> rather dangerous anyway.

For future reference, the goal of the stable branch is to maximize:

 user benefit / user risk

..so "cleanups" don't belong. At best, they have no user impact. At
worst, they introduce inadvertent breakage.
Martin von Zweigbergk - Oct. 24, 2014, 9:04 p.m.
On Fri, Oct 24, 2014 at 1:51 PM, Matt Mackall <mpm@selenic.com> wrote:
> On Thu, 2014-10-23 at 14:39 -0700, Martin von Zweigbergk wrote:
>> # HG changeset patch
>> # User Martin von Zweigbergk <martinvonz@google.com>
>> # Date 1414097000 25200
>> #      Thu Oct 23 13:43:20 2014 -0700
>> # Branch stable
>> # Node ID 47d1e211f68485ad2070fb505966edf34178a564
>> # Parent  2eb04f88de4b5103fb3c3584811b557b3ec2b771
>> context.status: remove overriding in workingctx
>>
>> The workingctx method simply calls the super method. The only effect
>> it has is that it uses a different default argument for the 'other'
>> argument. The only in-tree caller is patch.diff, which always passes
>> an argument to the method, so it should be safe to remove the
>> overriding. Having the default argument depend on the type seems
>> rather dangerous anyway.
>
> For future reference, the goal of the stable branch is to maximize:
>
>  user benefit / user risk
>
> ..so "cleanups" don't belong. At best, they have no user impact. At
> worst, they introduce inadvertent breakage.

I know, I know, but this was just so obviously related to the rest of
the series. But fair enough, I'll be sure to wait with such patches in
the future.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1495,14 +1495,6 @@ 
             match.bad = bad
         return match
 
-    def status(self, other='.', match=None, listignored=False,
-               listclean=False, listunknown=False, listsubrepos=False):
-        # yet to be determined: what to do if 'other' is a 'workingctx' or a
-        # 'memctx'?
-        return super(workingctx, self).status(other, match, listignored,
-                                              listclean, listunknown,
-                                              listsubrepos)
-
 class committablefilectx(basefilectx):
     """A committablefilectx provides common functionality for a file context
     that wants the ability to commit, e.g. workingfilectx or memfilectx."""