From patchwork Sun Nov 2 22:13:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,7] context.status: remove overriding in workingctx From: Martin von Zweigbergk X-Patchwork-Id: 6541 Message-Id: To: mercurial-devel@selenic.com Date: Sun, 02 Nov 2014 14:13:45 -0800 # HG changeset patch # User Martin von Zweigbergk # Date 1414097000 25200 # Thu Oct 23 13:43:20 2014 -0700 # Branch stable # Node ID d68ec9fdce58cb01ec349e2731cf09247b10f436 # Parent cc1cbb0bba8ed1d95c8f1b8e27d4d2893e0dcca7 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 @@ -1496,14 +1496,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."""