[PATCH 02 of 10 py3] hg: avoid sending unicode url into config infrastructure

Yuya Nishihara yuya at tcha.org
Wed Aug 2 11:07:49 EDT 2017


On Tue, 01 Aug 2017 16:34:30 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1500906158 14400
> #      Mon Jul 24 10:22:38 2017 -0400
> # Node ID 8b22554199879f80a13ddee556bc540ddcb65a94
> # Parent  87ee5c3b3271ded54fe4462aa43a9d1520b8a10b
> hg: avoid sending unicode url into config infrastructure
> 
> This was causing some unfortunate breakage on Python 3.
> 
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -31,6 +31,7 @@ from . import (
>      merge as mergemod,
>      node,
>      phases,
> +    pycompat,
>      repoview,
>      scmutil,
>      sshpeer,
> @@ -648,7 +649,8 @@ def clone(ui, peeropts, source, dest=Non
>              fp.write(template % defaulturl)
>              fp.close()
>  
> -            destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
> +            destrepo.ui.setconfig(
> +                'paths', 'default', pycompat.bytesurl(defaulturl), 'clone')

Perhaps both template and defaulturl should be bytes. I'll send a fix.


More information about the Mercurial-devel mailing list