changeset 416:5e9e8b8d2629

[PATCH] Removal of a file added by merging branches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] Removal of a file added by merging branches From: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk> Fixing a bug where removal of a file which is added when doing a merge would cause python exception to be thrown. manifest hash: 0bdd80e8abcee6aaa4804bb588f9939596fb3dd0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuNjLywK+sNU5EO8RAo44AJ4mvjsJcYOj/EmVDFrdkK3D3WHFSwCffxfV cRl8mXc252/oRcYaMZbgrlg= =S5x6 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 21 Jun 2005 19:19:39 -0800
parents c2b9502a4e96
children f2d1f5fd0179
files mercurial/hg.py tests/test-merge4 tests/test-merge4.out
diffstat 3 files changed, 35 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Jun 21 19:14:11 2005 -0800
+++ b/mercurial/hg.py	Tue Jun 21 19:19:39 2005 -0800
@@ -588,7 +588,9 @@
 
         # update manifest
         m1.update(new)
-        for f in remove: del m1[f]
+        for f in remove:
+            if f in m1:
+                del m1[f]
         mn = self.manifest.add(m1, mf1, tr, linkrev, c1[0], c2[0])
 
         # add changeset
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge4	Tue Jun 21 19:19:39 2005 -0800
@@ -0,0 +1,17 @@
+#!/bin/sh -x
+
+hg init
+echo This is file a1 > a
+hg add a
+hg commit -t "commit #0" -d "0 0" -u user
+echo This is file b1 > b
+hg add b
+hg commit -t "commit #1" -d "0 0" -u user
+hg update 0
+echo This is file c1 > c
+hg add c
+hg commit -t "commit #2" -d "0 0" -u user
+hg update -m 1
+rm b
+echo This is file c22 > c
+hg commit -t "commit #3" -d "0 0" -u user
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge4.out	Tue Jun 21 19:19:39 2005 -0800
@@ -0,0 +1,15 @@
++ hg init
++ echo This is file a1
++ hg add a
++ hg commit -t 'commit #0' -d '0 0' -u user
++ echo This is file b1
++ hg add b
++ hg commit -t 'commit #1' -d '0 0' -u user
++ hg update 0
++ echo This is file c1
++ hg add c
++ hg commit -t 'commit #2' -d '0 0' -u user
++ hg update -m 1
++ rm b
++ echo This is file c22
++ hg commit -t 'commit #3' -d '0 0' -u user