[PATCH] revert: add a XXX about rename tracking

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Aug 15 12:10:06 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1403625580 -3600
#      Tue Jun 24 16:59:40 2014 +0100
# Node ID b12294b39da84f2dad4d416161f5e48bb9966da3
# Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
revert: add a XXX about rename tracking

We check for rename information in the dirstate this is probably not enough to
preserve this behavior when using an explicit target revs.

I just spotted this while working on this code, but this is outside the scope
of my series so I'm just adding a comment to highlight this suspicious
situation.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2422,10 +2422,11 @@ def revert(ui, repo, ctx, parents, *pats
 
         # if f is a rename, update `names` to also revert the source
         cwd = repo.getcwd()
         for f in dsadded:
             src = repo.dirstate.copied(f)
+            # XXX should we check for rename down to target node?
             if src and src not in names and repo.dirstate[src] == 'r':
                 dsremoved.add(src)
                 names[src] = (repo.pathto(src, cwd), True)
 
         ## computation of the action to performs on `names` content.


More information about the Mercurial-devel mailing list