# HG changeset patch # User Idan Kamara # Date 1312995548 -10800 # Node ID f1af319604140240d5eb25d429ea06f8cdda36cd # Parent e0d21c9db20b692c76024dac7cf4ea27c04b8193 client: change return value of commit() to (rev, node) this is the original output hg emits with commit --debug diff -r e0d21c9db20b -r f1af31960414 hglib/client.py --- a/hglib/client.py Wed Aug 10 19:59:03 2011 +0300 +++ b/hglib/client.py Wed Aug 10 19:59:08 2011 +0300 @@ -186,7 +186,7 @@ out = self.rawcommand(args) rev, node = out.splitlines()[-1].rsplit(':') - return self.log(node)[0] + return int(rev.split()[-1]), node def config(self, refresh=False): if not self._config or refresh: diff -r e0d21c9db20b -r f1af31960414 tests/test-branch.py --- a/tests/test-branch.py Wed Aug 10 19:59:03 2011 +0300 +++ b/tests/test-branch.py Wed Aug 10 19:59:08 2011 +0300 @@ -8,7 +8,9 @@ def test_basic(self): self.assertEquals(self.client.branch('foo'), 'foo') self.append('a', 'a') - rev = self.client.commit('first', addremove=True) + rev, node = self.client.commit('first', addremove=True) + + rev = self.client.log(node)[0] self.assertEquals(rev.branch, 'foo') self.assertEquals(self.client.branches(), diff -r e0d21c9db20b -r f1af31960414 tests/test-branches.py --- a/tests/test-branches.py Wed Aug 10 19:59:03 2011 +0300 +++ b/tests/test-branches.py Wed Aug 10 19:59:08 2011 +0300 @@ -13,7 +13,8 @@ branches = self.client.branches() expected = [] - for r in (rev1, rev0): + for r, n in (rev1, rev0): + r = self.client.log(r)[0] expected.append((r.branch, int(r.rev), r.node[:12])) self.assertEquals(branches, expected) diff -r e0d21c9db20b -r f1af31960414 tests/test-log.py --- a/tests/test-log.py Wed Aug 10 19:59:03 2011 +0300 +++ b/tests/test-log.py Wed Aug 10 19:59:08 2011 +0300 @@ -4,14 +4,14 @@ class test_log(common.basetest): def test_basic(self): self.append('a', 'a') - rev0 = self.client.commit('first', addremove=True) + rev0, node0 = self.client.commit('first', addremove=True) self.append('a', 'a') - rev1 = self.client.commit('second') + rev1, node1 = self.client.commit('second') revs = self.client.log() revs.reverse() self.assertTrue(len(revs) == 2) - self.assertEquals(revs[1], rev1) + self.assertEquals(revs[1].node, node1) self.assertEquals(revs[0], self.client.log('0')[0]) diff -r e0d21c9db20b -r f1af31960414 tests/test-outgoing-incoming.py --- a/tests/test-outgoing-incoming.py Wed Aug 10 19:59:03 2011 +0300 +++ b/tests/test-outgoing-incoming.py Wed Aug 10 19:59:08 2011 +0300 @@ -15,10 +15,10 @@ self.assertEquals(self.client.outgoing(path='bar'), bar.incoming()) self.append('a', 'a') - rev = self.client.commit('third') + rev, node = self.client.commit('third') out = self.client.outgoing(path='bar') self.assertEquals(len(out), 1) - self.assertEquals(out[0], rev) + self.assertEquals(out[0].node, node) self.assertEquals(out, bar.incoming())