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

Martin von Zweigbergk martinvonz at google.com
Thu Oct 23 16:39:48 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at 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.

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."""


More information about the Mercurial-devel mailing list