hg merge: fix time asymmetry bug with deleting files on update to past
authormpm@selenic.com
Thu, 16 Jun 2005 22:32:55 -0800
changeset 383 4862a134e2c2
parent 382 37249c522770
child 384 a29decbf7475
hg merge: fix time asymmetry bug with deleting files on update to past -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg merge: fix time asymmetry bug with deleting files on update to past manifest hash: 41feb7bf9b56e071a538a0918224898acb2bd31c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCsm6XywK+sNU5EO8RAncbAKCwn/W4cr6civp4Zt79JFH6um0/lQCdFCh8 F7ZOQ+S/PL3HL4iE6avOBDc= =kHPm -----END PGP SIGNATURE-----
mercurial/hg.py
tests/test-backwards-remove
tests/test-backwards-remove.out
--- a/mercurial/hg.py	Thu Jun 16 08:37:15 2005 -0800
+++ b/mercurial/hg.py	Thu Jun 16 22:32:55 2005 -0800
@@ -1076,7 +1076,11 @@
                     remove.append(f) # other deleted it
             else:
                 if n == m1.get(f, nullid): # same as parent
-                    self.ui.debug("local created %s, keeping\n" % f)
+                    if p2 == pa: # going backwards?
+                        self.ui.debug("remote deleted %s\n" % f)
+                        remove.append(f)
+                    else:
+                        self.ui.debug("local created %s, keeping\n" % f)
                 else:
                     self.ui.debug("working dir created %s, keeping\n" % f)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-backwards-remove	Thu Jun 16 22:32:55 2005 -0800
@@ -0,0 +1,12 @@
+#!/bin/sh -x
+hg init
+echo This is file a1 > a
+hg add a
+hg commit -t "commit #0" -d "0 0" -u user
+ls
+echo This is file b1 > b
+hg add b
+hg commit -t "commit #1" -d "0 0" -u user
+hg co 0
+# B should disappear
+ls
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-backwards-remove.out	Thu Jun 16 22:32:55 2005 -0800
@@ -0,0 +1,12 @@
++ hg init
++ echo This is file a1
++ hg add a
++ hg commit -t 'commit #0' -d '0 0' -u user
++ ls
+a
++ echo This is file b1
++ hg add b
++ hg commit -t 'commit #1' -d '0 0' -u user
++ hg co 0
++ ls
+a