diff tests/test-commit.py @ 136:dc63978871ed

client: add support for 'hg commit --amend'
author David Douard <david.douard@logilab.fr>
date Thu, 23 Oct 2014 10:50:09 +0200
parents 1b47146a4a2c
children 4359cabcb0cc
line wrap: on
line diff
--- a/tests/test-commit.py	Wed Oct 01 15:03:32 2014 -0500
+++ b/tests/test-commit.py	Thu Oct 23 10:50:09 2014 +0200
@@ -40,3 +40,20 @@
                                          date=now.isoformat(' '))
 
         self.assertEquals(now, self.client.tip().date)
+
+    def test_amend(self):
+        self.append('a', 'a')
+        now = datetime.datetime.now().replace(microsecond=0)
+        rev0, node0 = self.client.commit('first', addremove=True,
+                                         date=now.isoformat(' '))
+
+        print rev0, node0
+        self.assertEquals(now, self.client.tip().date)
+
+        self.append('a', 'a')
+        rev1, node1 = self.client.commit(amend=True)
+        print rev1, node1
+        self.assertEquals(now, self.client.tip().date)
+        self.assertNotEquals(node0, node1)
+        self.assertEqual(1, len(self.client.log()))
+