From patchwork Fri Aug 15 17:10:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: revert: add a XXX about rename tracking From: Pierre-Yves David X-Patchwork-Id: 5435 Message-Id: To: mercurial-devel@selenic.com Cc: Pierre-Yves David Date: Fri, 15 Aug 2014 10:10:06 -0700 # HG changeset patch # User Pierre-Yves David # 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.