Patchwork [6,of,7] revert: explicitly get status against the parent

login
register
mail settings
Submitter Pierre-Yves David
Date May 19, 2014, 3:58 p.m.
Message ID <2d09f1521f9497365ae7.1400515085@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4801/
State Accepted
Commit 7cfe51661e98ae7688f0c6a1a15f241e7df711cd
Headers show

Comments

Pierre-Yves David - May 19, 2014, 3:58 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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: