Comments
Patch
@@ -1,7 +1,7 @@
import hglib.client # Circular dependency.
from hglib import util, templates
from hglib.error import CommandError
-from hglib.util import b
+from hglib.util import b, strtobytes
_nullcset = [b('-1'), b('0000000000000000000000000000000000000000'), b(''),
b(''), b(''), b(''), b('')]
@@ -20,7 +20,7 @@
cset = _nullcset
else:
if isinstance(changeid, (long, int)):
- changeid = b('rev(') + str(changeid).encode('latin-1') + b(')')
+ changeid = b('rev(') + strtobytes(changeid) + b(')')
notfound = False
try:
@@ -1,6 +1,6 @@
from tests import common
from hglib import error
-from hglib.util import b
+from hglib.util import b, strtobytes
class test_update(common.basetest):
def setUp(self):
@@ -92,7 +92,7 @@
rev2, node2 = self.client.commit(b('third'))
# Go back to 0
- self.client.rawcommand([b('update'), str(self.rev0).encode('latin-1')],
+ self.client.rawcommand([b('update'), strtobytes(self.rev0)],
# Keep the 'changed' version
prompt=lambda s, d: 'c\n')
u, m, r, ur = self.client.update(rev2, clean=True)