Would you expect bytes or unicode (or both) for the hglib API in Python 3?

Brett Cannon bcannon at gmail.com
Thu Mar 5 16:58:01 CST 2015


On Tue, Jan 27, 2015 at 6:19 PM Matt Mackall <mpm at selenic.com> wrote:

> On Tue, 2015-01-27 at 17:49 -0500, Brett Cannon wrote:
> > I have a need to query Mercurial repositories for some log data and I
> want
> > to do it from Python 3. I would like to use hglib but it currently
> doesn't
> > support past Python 2.7. I'm willing to try and port it so it can
> (somehow)
> > support Python 2.4 - Python 3.4, but before I do that I would like to
> know
> > two things: 1) would you accept a porting of the library to Python 3 if
> it
> > can still support Python 2.4 (although obviously my life would be easier
> if
> > Python 2.6 was the cut-off =), and 2) what kind of Python 3 API would you
> > want the library to have?
>
> Thanks for looking into this!
>
> For (1), yes, but I'd also consider a second branch in the repo if that
> proved impossible. I wouldn't bother supporting 3.x < 3.4 though.
>

So I have a patched repository that has hglib working from Python 2.4 -
3.4. Considering it required touching every string literal in hglib it
isn't a small change. But doing it piecemeal didn't work out either as the
test suite typically executes multiple commands in a single test file so it
wasn't exactly isolated work. Luckily it isn't a complicated set of changes
either.

So how should I send this change in? Single patch? Single patch for the
library code, separate patch for all the tests? I can't send the changes
as-is since I didn't follow your commit message format for anything.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150305/c2b601bb/attachment.html>


More information about the Mercurial-devel mailing list