diff tests/test_externals.py @ 785:40ddf8213fa2

pushmod: do not delete the whole branch when deleting .hgsub When deleting .hgsub, and only .hgsub, the root directory '' was marked as changed. Since it was not listed in the existing directory list, this single record was enough to trigger a deletion of the current branch. We changed the directory parser to always emit the '' element.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 13 Feb 2011 20:14:01 +0100
parents f214fb3f92cd
children a5be5ca638de
line wrap: on
line diff
--- a/tests/test_externals.py
+++ b/tests/test_externals.py
@@ -362,6 +362,20 @@ HEAD subdir1/deps/project2
         self.assertTrue('subdir2/a' in self.repo['tip'])
         self.assertTrue('subdir1/a' not in self.repo['tip'])
 
+        # Move the externals so they are defined on the base directory,
+        # this used to cause full branch removal when deleting the .hgsub
+        changes = [
+            ('.hgsub', '.hgsub', """\
+subdir1/deps/project1 = [hgsubversion] :^/externals/project1 subdir1/deps/project1
+"""),
+            ('.hgsubstate', '.hgsubstate', """\
+HEAD subdir1/deps/project1
+"""),
+            ]
+        self.commitchanges(changes)
+        self.pushrevisions(stupid)
+        self.assertchanges(changes, self.repo['tip'])
+
         # Test externals removal
         changes = [
             ('.hgsub', None, None),