Mercurial > hg > pyhgsh
comparison mercurial/hg.py @ 273:4f8174389001
merge: Fix bug where we overwrote local when local was newer
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
merge: Fix bug where we overwrote local when local was newer
Spotted by Arun Sharma
manifest hash: b81acb971c6471d95748cd349590cc70e448dce3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCpl9oywK+sNU5EO8RAtseAJ92EEMovbVy0J1rFuxcGvED066m+ACfaWYF
Q1/PcvkuH9aIqwMNkMK+aPU=
=61JM
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Tue, 07 Jun 2005 19:00:56 -0800 |
parents | e8eb427c6d71 |
children | 61d45b0ba8fb |
comparison
equal
deleted
inserted
replaced
272:467cea2bf2d8 | 273:4f8174389001 |
---|---|
871 for f, n in mw.iteritems(): | 871 for f, n in mw.iteritems(): |
872 if f in m2: | 872 if f in m2: |
873 if n != m2[f]: | 873 if n != m2[f]: |
874 a = ma.get(f, nullid) | 874 a = ma.get(f, nullid) |
875 if n != a and m2[f] != a: | 875 if n != a and m2[f] != a: |
876 self.ui.debug(" %s versions differ, do resolve\n" % f) | 876 self.ui.debug(" %s versions differ, resolve\n" % f) |
877 merge[f] = (m1.get(f, nullid), m2[f]) | 877 merge[f] = (m1.get(f, nullid), m2[f]) |
878 else: | 878 elif m2[f] != a: |
879 self.ui.debug(" remote %s is newer, get\n" % f) | |
879 get[f] = m2[f] | 880 get[f] = m2[f] |
880 del m2[f] | 881 del m2[f] |
881 elif f in ma: | 882 elif f in ma: |
882 if n != ma[f]: | 883 if n != ma[f]: |
883 r = self.ui.prompt( | 884 r = self.ui.prompt( |
923 # get the files we don't need to change | 924 # get the files we don't need to change |
924 files = get.keys() | 925 files = get.keys() |
925 files.sort() | 926 files.sort() |
926 for f in files: | 927 for f in files: |
927 if f[0] == "/": continue | 928 if f[0] == "/": continue |
928 self.ui.note(f, "\n") | 929 self.ui.note("getting %s\n" % f) |
929 t = self.file(f).revision(get[f]) | 930 t = self.file(f).revision(get[f]) |
930 try: | 931 try: |
931 file(self.wjoin(f), "w").write(t) | 932 file(self.wjoin(f), "w").write(t) |
932 except IOError: | 933 except IOError: |
933 os.makedirs(os.path.dirname(f)) | 934 os.makedirs(os.path.dirname(f)) |