changeset 383:4862a134e2c2

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-----
author mpm@selenic.com
date Thu, 16 Jun 2005 22:32:55 -0800
parents 37249c522770
children a29decbf7475
files mercurial/hg.py tests/test-backwards-remove tests/test-backwards-remove.out
diffstat 3 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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