[PATCH] revert: add a XXX about rename tracking

Augie Fackler raf at durin42.com
Mon Aug 18 17:31:22 CDT 2014


On Fri, Aug 15, 2014 at 10:10:06AM -0700, Pierre-Yves David wrote:
> # 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

Queued. BTW when I queued this with 8dda as my working copy, 'hg
import --obsolete' gave me a self-obsoleting change again. It took
some fighting to get out of the bad state.

Would you object to a change to the obsstore that banned creation of
cycles?

>
> 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.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list