From patchwork Thu Mar 26 00:39:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 7, hglib] hglib: make sure hgclient.diff() works with bytes (issue4520) From: Brett Cannon X-Patchwork-Id: 8278 Message-Id: <11202c85737eef4677aa.1427330395@bcannon-macbookpro2.roam.corp.google.com> To: mercurial-devel@selenic.com Date: Wed, 25 Mar 2015 20:39:55 -0400 # HG changeset patch # User Brett Cannon # 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) 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,