diff hglib/client.py @ 154:11202c85737e

hglib: make sure hgclient.diff() works with bytes (issue4520)
author Brett Cannon <brett@python.org>
date Wed, 25 Mar 2015 20:15:54 -0400
parents c1b966866ed7
children f22f3ff3cfae
line wrap: on
line diff
--- a/hglib/client.py	Fri Mar 20 16:34:42 2015 -0400
+++ b/hglib/client.py	Wed Mar 25 20:15:54 2015 -0400
@@ -2,7 +2,7 @@
 import hglib
 from hglib import error, util, templates, merge, context
 
-from hglib.util import b, cmdbuilder, BytesIO
+from hglib.util import b, cmdbuilder, BytesIO, strtobytes
 
 class revision(tuple):
     def __new__(cls, rev, node, tags, branch, author, desc, date):
@@ -668,7 +668,7 @@
         if change and revs:
             raise ValueError('cannot specify both change and rev')
 
-        args = cmdbuilder(b('diff'), r=revs, c=change,
+        args = cmdbuilder(b('diff'), r=list(map(strtobytes, revs)), c=change,
                           a=text, g=git, nodates=nodates,
                           p=showfunction, reverse=reverse,
                           w=ignoreallspace, b=ignorespacechange,