Patchwork [1,of,7,hglib] hglib: make sure hgclient.diff() works with bytes (issue4520)

login
register
mail settings
Submitter Brett Cannon
Date March 26, 2015, 12:39 a.m.
Message ID <11202c85737eef4677aa.1427330395@bcannon-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/8278/
State Accepted
Headers show

Comments

Brett Cannon - March 26, 2015, 12:39 a.m.
# HG changeset patch
# User Brett Cannon <brett@python.org>
# Date 1427328954 14400
#      Wed Mar 25 20:15:54 2015 -0400
# Node ID 11202c85737eef4677aa68f950ec985a5491c2ee
# Parent  ef8eb78fc88df516d835d4ab532807aee4d0e82f
hglib: make sure hgclient.diff() works with bytes (issue4520)

Patch

diff -r ef8eb78fc88d -r 11202c85737e hglib/client.py
--- 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,