[PATCH] merge: avoid to break the dirstate copy status on moved files

Gilles Moris gilles.moris at free.fr
Wed May 5 15:04:55 CDT 2010


On Wednesday 05 May 2010 12:48:50 am Benoit Boissinot wrote:
> > > Do you have an example, that would help reviewing it.
> > >
> > > thanks,
> > >
> > > Benoit
> >
> > Here is the scenario:
> >
> > hg init repo
> > cd repo
> > echo a > file
> > hg ci -Am a
> > echo b >> file
> > hg ci -m b
> > hg up 0
> > hg mv file renamed
> > hg st -C
> >   A renamed
> >     file
> >   R file
> > hg up 1
> > hg st -C
> >   M renamed
> >   R file
>
> By the way, the other way round is buggy as well (changeset 1 moves file
> to renamed, update back to 0, modify file, update to 1, it should merge
> file and renamed, but it doesn't).
>
> regards,
>
> Benoit

Actually it (the other way round) has been fixed in 1.5.2 by:

changeset:   10873:4f11978ae45d
branch:      stable
user:        Henrik Stuart <henrik.stuart at edlund.dk>
date:        Wed Apr 07 21:31:47 2010 +0200
summary:     copies: properly visit file context ancestors on working file 
             contexts

But the backward merge still has the problem:

hg init repo
cd repo
echo a > file
hg ci -Am a
hg mv file renamed
hg ci -m r
echo b >> renamed
hg up 0
  local changed renamed which remote deleted
  use (c)hanged version or (d)elete?

I guess that copies has not been implemented to handle backward merge, and I 
don't know it can be modified. The problem here is if you choose delete: this 
will simply blow out your local changes for this file, so loss of 
information.
Shall I enter an issue in the tracker for that one ?

Regards.
Gilles.


More information about the Mercurial-devel mailing list