# HG changeset patch # User Idan Kamara # Date 1313272593 -10800 # Node ID 1e33bbea23e51aec0cb48fd1615f8b3eef2bdc7f # Parent f6e1d9a6e0cd91e85046bd3384cd4dce737a524c client: handle spaces correctly in status() diff -r f6e1d9a6e0cd -r 1e33bbea23e5 hglib/client.py --- a/hglib/client.py Sun Aug 14 00:51:15 2011 +0300 +++ b/hglib/client.py Sun Aug 14 00:56:33 2011 +0300 @@ -546,7 +546,10 @@ for entry in out.split('\0'): if entry: - l.append(tuple(entry.rsplit(' ', 1))) + if entry[0] == ' ': + l.append((' ', entry[2:])) + else: + l.append(tuple(entry.split(' ', 1))) return l diff -r f6e1d9a6e0cd -r 1e33bbea23e5 tests/test-status.py --- a/tests/test-status.py Sun Aug 14 00:51:15 2011 +0300 +++ b/tests/test-status.py Sun Aug 14 00:56:33 2011 +0300 @@ -39,3 +39,10 @@ self.client.copy('source', 'dest') l = [('A', 'dest'), (' ', 'source')] self.assertEquals(self.client.status(copies=True), l) + + def test_copy_origin_space(self): + self.append('s ource', 'a') + self.client.commit('first', addremove=True) + self.client.copy('s ource', 'dest') + l = [('A', 'dest'), (' ', 's ource')] + self.assertEquals(self.client.status(copies=True), l)