changeset 296:a3d83bf86755

hg update: fix clobbering files when going backwards -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg update: fix clobbering files when going backwards spotted by Andrew Thompson manifest hash: 0cfc2d189a395fb8761391d9918864034aa7a9b8 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCqH9BywK+sNU5EO8RAoHrAJwN9Y2Jrvbdp/seTkGl6D/g1uxK0wCglZWz jQ6F3A6ikzTXwhEq+KsR8Qw= =9IPU -----END PGP SIGNATURE-----
author mpm@selenic.com
date Thu, 09 Jun 2005 09:41:21 -0800
parents 38919e1c254d
children 7c239fad0f27
files mercurial/hg.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Jun 08 22:03:18 2005 -0800
+++ b/mercurial/hg.py	Thu Jun 09 09:41:21 2005 -0800
@@ -908,8 +908,10 @@
             if f in m2:
                 s = 0
 
+                # are files different?
                 if n != m2[f]:
                     a = ma.get(f, nullid)
+                    # are both different from the ancestor?
                     if n != a and m2[f] != a:
                         self.ui.debug(" %s versions differ, resolve\n" % f)
                         merge[f] = (m1.get(f, nullid), m2[f])
@@ -919,7 +921,8 @@
                         mode = ((a^b) | (a^c)) ^ a
                         merge[f] = (m1.get(f, nullid), m2[f], mode)
                         s = 1
-                    elif m2[f] != a:
+                    # is this an unmodified file or are we clobbering?
+                    elif mw[f] == m1[f] or force:
                         self.ui.debug(" remote %s is newer, get\n" % f)
                         get[f] = m2[f]
                         s = 1