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

Benoit Boissinot bboissin at gmail.com
Tue May 4 17:22:06 CDT 2010


On Tue, May 04, 2010 at 11:25:46PM +0200, Gilles Moris wrote:
> On Tuesday 04 May 2010 02:32:26 pm Benoit Boissinot wrote:
> > On Tue, May 4, 2010 at 9:57 AM, Gilles Moris <gilles.moris at free.fr> wrote:
> > > merge: avoid to break the dirstate copy status on moved files
> > >
> > > In the case a file is locally tracked as copied in dirstate, and that a
> > > merge affects this file, this file should not be marked as modified in
> > > dirstate, as this will break the current copy state.
> > > Note: only affect working directory merge, not branch merge.
> >
> > Do you have an example, that would help reviewing it.
> >
> 
> 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
> 
> This patch does not break the test suite, seems to keep working in case of 
> convergent and divergent renames, but but needs an expert review as I still 
> not fully embrace what the fd variable is used for.

Thanks, it helps.

I think, instead of not calling normallookup(), we should unify the
branchmerge and non-branchmerge cases (move the part calling
dirstate.copy() out of the if).

And looking at the code, the "d" case (directory rename) probably need
the same fix, right?

regards,

Benoit

-- 
:wq


More information about the Mercurial-devel mailing list