Patchwork [2,of,5] py3: replace str(None) with literal in convcmd.py

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 27, 2017, 12:34 p.m.
Message ID <40669eaa31e2c2371481.1506515679@mimosa>
Download mbox | patch
Permalink /patch/24181/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 27, 2017, 12:34 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1506506903 -32400
#      Wed Sep 27 19:08:23 2017 +0900
# Node ID 40669eaa31e2c2371481fc50f7ed725b17063f6e
# Parent  b27593faa8b3d4ddcf71dcb323ae8189691929df
py3: replace str(None) with literal in convcmd.py

Patch

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -87,7 +87,7 @@  def mapbranch(branch, branchmap):
     # At some point we used "None" literal to denote the default branch,
     # attempt to use that for backward compatibility.
     if (not branch):
-        branch = branchmap.get(str(None), branch)
+        branch = branchmap.get('None', branch)
     return branch
 
 source_converters = [
diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -71,7 +71,7 @@  testmod('mercurial.ui')
 testmod('mercurial.url')
 testmod('mercurial.util', py3=False)  # py3: multiple bytes/unicode issues
 testmod('mercurial.util', testtarget='platform')
-testmod('hgext.convert.convcmd', py3=False)  # py3: use of str() ?
+testmod('hgext.convert.convcmd')
 testmod('hgext.convert.cvsps')
 testmod('hgext.convert.filemap')
 testmod('hgext.convert.p4')