Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 11178:21a7ae13208f
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.
author | Gilles Moris <gilles.moris@free.fr> |
---|---|
date | Tue, 04 May 2010 09:57:16 +0200 |
parents | 502474839293 |
children | 6f1d1ed3e19a |
comparison
equal
deleted
inserted
replaced
11177:6a64813276ed | 11178:21a7ae13208f |
---|---|
384 # We've update-merged a locally modified file, so | 384 # We've update-merged a locally modified file, so |
385 # we set the dirstate to emulate a normal checkout | 385 # we set the dirstate to emulate a normal checkout |
386 # of that file some time in the past. Thus our | 386 # of that file some time in the past. Thus our |
387 # merge will appear as a normal local file | 387 # merge will appear as a normal local file |
388 # modification. | 388 # modification. |
389 repo.dirstate.normallookup(fd) | 389 if f2 == fd: # file not locally copied/moved |
390 repo.dirstate.normallookup(fd) | |
390 if move: | 391 if move: |
391 repo.dirstate.forget(f) | 392 repo.dirstate.forget(f) |
392 elif m == "d": # directory rename | 393 elif m == "d": # directory rename |
393 f2, fd, flag = a[2:] | 394 f2, fd, flag = a[2:] |
394 if not f2 and f not in repo.dirstate: | 395 if not f2 and f not in repo.dirstate: |