Mercurial > python-hglib
comparison 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 |
comparison
equal
deleted
inserted
replaced
135:f6b6e16531f8 | 136:dc63978871ed |
---|---|
38 now = datetime.datetime.now().replace(microsecond=0) | 38 now = datetime.datetime.now().replace(microsecond=0) |
39 rev0, node0 = self.client.commit('first', addremove=True, | 39 rev0, node0 = self.client.commit('first', addremove=True, |
40 date=now.isoformat(' ')) | 40 date=now.isoformat(' ')) |
41 | 41 |
42 self.assertEquals(now, self.client.tip().date) | 42 self.assertEquals(now, self.client.tip().date) |
43 | |
44 def test_amend(self): | |
45 self.append('a', 'a') | |
46 now = datetime.datetime.now().replace(microsecond=0) | |
47 rev0, node0 = self.client.commit('first', addremove=True, | |
48 date=now.isoformat(' ')) | |
49 | |
50 print rev0, node0 | |
51 self.assertEquals(now, self.client.tip().date) | |
52 | |
53 self.append('a', 'a') | |
54 rev1, node1 = self.client.commit(amend=True) | |
55 print rev1, node1 | |
56 self.assertEquals(now, self.client.tip().date) | |
57 self.assertNotEquals(node0, node1) | |
58 self.assertEqual(1, len(self.client.log())) | |
59 |