[PATCH 5 of 8 RFC] update: when guarding, abort on copies of modified files

Laurens Holst laurens.nospam at grauw.nl
Wed Dec 21 13:45:55 CST 2011


# HG changeset patch
# User Laurens Holst <laurens.hg at grauw.nl>
# Date 1324478960 -3600
# Node ID 801d2be93c0fd3b16fd61b1d04acb154b4879125
# Parent  64831bdb5dddf916d5378ace8965a2b2d619d5ee
update: when guarding, abort on copies of modified files

Even though a copy does not cause a conflict, the reason to abort when guarding
is because they are not reversible by updating to an earlier revision without
prompting for user input.

Moves should be reversible, but in the current code if you update back in
history the user is prompted whether he wants to delete the changed file. So
until that is changed, it aborts on moves too.

diff -r 64831bdb5ddd -r 801d2be93c0f mercurial/merge.py
--- a/mercurial/merge.py	Wed Dec 21 03:14:09 2011 +0100
+++ b/mercurial/merge.py	Wed Dec 21 15:49:20 2011 +0100
@@ -647,6 +647,9 @@
         elif m == "m":
             f2, fd, flags, move = a[2:]
 
+            if f != f2: # copies are not reversible
+                return False
+
             fcl = localctx[f]
             fco = otherctx[f2]
 


More information about the Mercurial-devel mailing list