Mercurial > hg-stable
changeset 23079:c4ce50a3d634 stable
keyword: use parent of working copy as base for status
Instead of calling repo[None].status(), use the more common form that
uses the parent of the working copy as the base:
repo['.'].status(). Note that the former defaults to comparing to
revision '.', while the latter defaults to revision None, so the
contexts being compared are the same.
It might seem like this would result in a reverse diff, but it turns
out that workingctx.status() incorrectly reverses the result. That bug
will be fixed in a later commit.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 23 Oct 2014 13:17:37 -0700 |
parents | eb763217152a |
children | c586cb50872b |
files | hgext/keyword.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/keyword.py Thu Oct 23 21:53:37 2014 +0900 +++ b/hgext/keyword.py Thu Oct 23 13:17:37 2014 -0700 @@ -619,7 +619,7 @@ ret = super(kwrepo, self).rollback(dryrun, force) if not dryrun: ctx = self['.'] - modified, added = _preselect(self[None].status(), changed) + modified, added = _preselect(ctx.status(), changed) kwt.overwrite(ctx, modified, True, True) kwt.overwrite(ctx, added, True, False) return ret @@ -702,7 +702,7 @@ # therefore compare nodes before and after kwt.postcommit = True ctx = repo['.'] - wstatus = repo[None].status() + wstatus = ctx.status() ret = orig(ui, repo, commitfunc, *pats, **opts) recctx = repo['.'] if ctx != recctx: