Revert changeset c67920d78248.
authorGiorgos Keramidas <keramida@ceid.upatras.gr>
Tue, 10 Oct 2006 21:03:24 +0300
changeset 3325 50a18815e3f0
parent 3324 34f08b8883cf
child 3326 be8efb6e1cc6
Revert changeset c67920d78248. It breaks 'hg merge && hg up -c REV' when files exist only in one of the manifests, making hg throw a traceback like:
mercurial/context.py
tests/test-manifest-merging
tests/test-manifest-merging.out
--- a/mercurial/context.py	Tue Oct 10 11:47:19 2006 +0200
+++ b/mercurial/context.py	Tue Oct 10 21:03:24 2006 +0300
@@ -360,7 +360,8 @@
                 man.set(f, util.is_exec(self._repo.wjoin(f), man.execf(f)))
 
         for f in deleted + removed:
-            del man[f]
+            if f in man:
+                del man[f]
 
         self._manifest = man
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-manifest-merging	Tue Oct 10 21:03:24 2006 +0300
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+echo % init foo-base
+hg init foo-base
+
+echo % create alpha in first repo
+cd foo-base
+echo 'alpha' > alpha
+hg ci -A -m 'add alpha' -d '1 0'
+cd ..
+
+echo % clone foo-base to foo-work
+hg clone foo-base foo-work
+
+echo % create beta in second repo
+cd foo-work
+echo 'beta' > beta
+hg ci -A -m 'add beta' -d '2 0'
+cd ..
+
+echo % create gamma in first repo
+cd foo-base
+echo 'gamma' > gamma
+hg ci -A -m 'add gamma' -d '3 0'
+cd ..
+
+echo % pull into work and merge
+cd foo-work
+hg pull
+hg merge
+
+echo % revert to changeset 1 to simulate a failed merge
+rm -fr *
+hg up -C 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-manifest-merging.out	Tue Oct 10 21:03:24 2006 +0300
@@ -0,0 +1,21 @@
+% init foo-base
+% create alpha in first repo
+adding alpha
+% clone foo-base to foo-work
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% create beta in second repo
+adding beta
+% create gamma in first repo
+adding gamma
+% pull into work and merge
+pulling from /tmp/hgtests.H64eVH/test-manifest-merging/foo-base
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files (+1 heads)
+(run 'hg heads' to see heads, 'hg merge' to merge)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+% revert to changeset 1 to simulate a failed merge
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved