Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 23080:c586cb50872b stable
context.status: remove incorrect swapping of added/removed in workingctx
The comment in workingctx.status() says that "calling 'super' subtly
reveresed the contexts", but that is simply not true, so we should not
be swapping added and removed fields.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Oct 2014 15:52:20 -0500 |
parents | c1aede895072 |
children | e9165c18f8df |
comparison
equal
deleted
inserted
replaced
23079:c4ce50a3d634 | 23080:c586cb50872b |
---|---|
1497 | 1497 |
1498 def status(self, other='.', match=None, listignored=False, | 1498 def status(self, other='.', match=None, listignored=False, |
1499 listclean=False, listunknown=False, listsubrepos=False): | 1499 listclean=False, listunknown=False, listsubrepos=False): |
1500 # yet to be determined: what to do if 'other' is a 'workingctx' or a | 1500 # yet to be determined: what to do if 'other' is a 'workingctx' or a |
1501 # 'memctx'? | 1501 # 'memctx'? |
1502 s = super(workingctx, self).status(other, match, listignored, listclean, | 1502 return super(workingctx, self).status(other, match, listignored, |
1503 listunknown, listsubrepos) | 1503 listclean, listunknown, |
1504 # calling 'super' subtly reveresed the contexts, so we flip the results | 1504 listsubrepos) |
1505 # (s[1] is 'added' and s[2] is 'removed') | |
1506 s = list(s) | |
1507 s[1], s[2] = s[2], s[1] | |
1508 return scmutil.status(*s) | |
1509 | 1505 |
1510 class committablefilectx(basefilectx): | 1506 class committablefilectx(basefilectx): |
1511 """A committablefilectx provides common functionality for a file context | 1507 """A committablefilectx provides common functionality for a file context |
1512 that wants the ability to commit, e.g. workingfilectx or memfilectx.""" | 1508 that wants the ability to commit, e.g. workingfilectx or memfilectx.""" |
1513 def __init__(self, repo, path, filelog=None, ctx=None): | 1509 def __init__(self, repo, path, filelog=None, ctx=None): |