changeset 7576:f9784c425a96

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sat, 03 Jan 2009 21:54:58 +0100
parents 3ccaefc84f45 (current diff) f1af59451c0c (diff)
children 766d9cf58b3f
files
diffstat 3 files changed, 60 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Jan 03 21:44:15 2009 +0100
+++ b/mercurial/localrepo.py	Sat Jan 03 21:54:58 2009 +0100
@@ -882,16 +882,15 @@
 
             # update manifest
             m1.update(new)
-            removed = []
+            removed = [f for f in util.sort(remove) if f in m1 or f in m2]
+            removed1 = []
 
-            for f in util.sort(remove):
+            for f in removed:
                 if f in m1:
                     del m1[f]
-                    removed.append(f)
-                elif f in m2:
-                    removed.append(f)
+                    removed1.append(f)
             mn = self.manifest.add(m1, trp, linkrev, c1[0], c2[0],
-                                   (new, removed))
+                                   (new, removed1))
 
             # add changeset
             if (not empty_ok and not text) or force_editor:
--- a/tests/test-586	Sat Jan 03 21:44:15 2009 +0100
+++ b/tests/test-586	Sat Jan 03 21:54:58 2009 +0100
@@ -17,3 +17,33 @@
 hg ci -Amc
 
 hg st -A
+cd ..
+
+# a test for issue 1433, related to issue586
+echo % create test repos
+hg init repoa
+touch repoa/a
+hg -R repoa ci -Am adda
+
+hg init repob
+touch repob/b
+hg -R repob ci -Am addb
+
+hg init repoc
+cd repoc
+hg pull ../repoa
+hg update
+mkdir tst
+hg mv * tst
+hg ci -m "import a in tst"
+hg pull -f ../repob
+echo % merge both repos
+hg merge
+mkdir src
+echo % move b content
+hg mv b src
+hg ci -m "import b in src"
+hg manifest
+
+
+
--- a/tests/test-586.out	Sat Jan 03 21:44:15 2009 +0100
+++ b/tests/test-586.out	Sat Jan 03 21:54:58 2009 +0100
@@ -11,3 +11,28 @@
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 C b
+% create test repos
+adding a
+adding b
+pulling from ../repoa
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+(run 'hg update' to get a working copy)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+pulling from ../repob
+searching for changes
+warning: repository is unrelated
+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)
+% merge both repos
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+% move b content
+src/b
+tst/a