comparison mercurial/hg.py @ 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 09364bcebdf0
children 7c239fad0f27
comparison
equal deleted inserted replaced
295:38919e1c254d 296:a3d83bf86755
906 906
907 for f, n in mw.iteritems(): 907 for f, n in mw.iteritems():
908 if f in m2: 908 if f in m2:
909 s = 0 909 s = 0
910 910
911 # are files different?
911 if n != m2[f]: 912 if n != m2[f]:
912 a = ma.get(f, nullid) 913 a = ma.get(f, nullid)
914 # are both different from the ancestor?
913 if n != a and m2[f] != a: 915 if n != a and m2[f] != a:
914 self.ui.debug(" %s versions differ, resolve\n" % f) 916 self.ui.debug(" %s versions differ, resolve\n" % f)
915 merge[f] = (m1.get(f, nullid), m2[f]) 917 merge[f] = (m1.get(f, nullid), m2[f])
916 # merge executable bits 918 # merge executable bits
917 # "if we changed or they changed, change in merge" 919 # "if we changed or they changed, change in merge"
918 a, b, c = mfa.get(f, 0), mfw[f], mf2[f] 920 a, b, c = mfa.get(f, 0), mfw[f], mf2[f]
919 mode = ((a^b) | (a^c)) ^ a 921 mode = ((a^b) | (a^c)) ^ a
920 merge[f] = (m1.get(f, nullid), m2[f], mode) 922 merge[f] = (m1.get(f, nullid), m2[f], mode)
921 s = 1 923 s = 1
922 elif m2[f] != a: 924 # is this an unmodified file or are we clobbering?
925 elif mw[f] == m1[f] or force:
923 self.ui.debug(" remote %s is newer, get\n" % f) 926 self.ui.debug(" remote %s is newer, get\n" % f)
924 get[f] = m2[f] 927 get[f] = m2[f]
925 s = 1 928 s = 1
926 929
927 if not s and mfw[f] != mf2[f]: 930 if not s and mfw[f] != mf2[f]: