[PATCH 6 of 7] revert: explicitly get status against the parent
pierre-yves.david at ens-lyon.org
pierre-yves.david at ens-lyon.org
Mon May 19 10:58:05 CDT 2014
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1400089045 25200
# Wed May 14 10:37:25 2014 -0700
# Node ID 2d09f1521f9497365ae7bdae5e0700441123ec20
# Parent b76ab6980b95e67d4e71162da416de47864b03a1
revert: explicitly get status against the parent
This make absolutely no functional changes. The default value for node1 is
already the same than the current value of parent. But to be able to properly use the
second parent in merge context, we have to start to be a bit more explicit
about what we compute the status against.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2286,11 +2286,11 @@ def revert(ui, repo, ctx, parents, *pats
# get the list of subrepos that must be reverted
targetsubs = sorted(s for s in ctx.substate if m(s))
# Find status of all file in `names`. (Against working directory parent)
m = scmutil.matchfiles(repo, names)
- changes = repo.status(match=m)[:4]
+ changes = repo.status(node1=parent, match=m)[:4]
modified, added, removed, deleted = map(set, changes)
# if f is a rename, update `names` to also revert the source
cwd = repo.getcwd()
for f in added:
More information about the Mercurial-devel
mailing list