diff tests/test_push_command.py @ 929:8417be758047

pushmod: keep the root svn dir when emptying the hg repo (issue359)
author Patrick Mezard <patrick@mezard.eu>
date Sun, 09 Sep 2012 16:12:28 +0200
parents d99ed94f4760
children def2144c0a8c
line wrap: on
line diff
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -503,6 +503,25 @@ class PushTests(test_util.TestBase):
         self.commitchanges(changes, parent=par)
         self.pushrevisions()
 
+    def test_push_emptying_changeset(self):
+        r = self.repo['tip']
+        changes = [
+                ('alpha', None, None),
+                ('beta', None, None),
+                ]
+        parent = self.repo['tip'].rev()
+        self.commitchanges(changes, parent=parent)
+        self.pushrevisions()
+        self.assertEqual({}, self.repo['tip'].manifest())
+
+        # Try to re-add a file after emptying the branch
+        changes = [
+                ('alpha', 'alpha', 'alpha'),
+                ]
+        self.commitchanges(changes, parent=self.repo['tip'].rev())
+        self.pushrevisions()
+        self.assertEqual(['alpha'], list(self.repo['tip'].manifest()))
+
 def suite():
     test_classes = [PushTests, ]
     all_tests = []