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

Gilles Moris gilles.moris at free.fr
Tue May 4 02:57:25 CDT 2010


 mercurial/merge.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1272959836 -7200
# Node ID b3046a5f0653552e42c6043d16055995c2978f41
# Parent  35ae6a16b7666185bbb5533c5e85e88c2364f6ea
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.

diff -r 35ae6a16b766 -r b3046a5f0653 mercurial/merge.py
--- a/mercurial/merge.py	Thu Feb 12 22:55:51 2009 +0100
+++ b/mercurial/merge.py	Tue May 04 09:57:16 2010 +0200
@@ -386,7 +386,8 @@
                 # of that file some time in the past. Thus our
                 # merge will appear as a normal local file
                 # modification.
-                repo.dirstate.normallookup(fd)
+                if f2 == fd: # file not locally copied/moved
+                    repo.dirstate.normallookup(fd)
                 if move:
                     repo.dirstate.forget(f)
         elif m == "d": # directory rename


More information about the Mercurial-devel mailing list