Patchwork D2527: convert: use our shlex wrapper in filemap to avoid Python 3 tracebacks

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 1:54 a.m.
Message ID <7ee69104340c4822b64acdf7f35c60da@localhost.localdomain>
Download mbox | patch
Permalink /patch/28645/
State Not Applicable
Headers show

Comments

phabricator - March 2, 2018, 1:54 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc48c3da88e6c: convert: use our shlex wrapper in filemap to avoid Python 3 tracebacks (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2527?vs=6303&id=6319

REVISION DETAIL
  https://phab.mercurial-scm.org/D2527

AFFECTED FILES
  hgext/convert/filemap.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/convert/filemap.py b/hgext/convert/filemap.py
--- a/hgext/convert/filemap.py
+++ b/hgext/convert/filemap.py
@@ -7,7 +7,6 @@ 
 from __future__ import absolute_import, print_function
 
 import posixpath
-import shlex
 
 from mercurial.i18n import _
 from mercurial import (
@@ -71,8 +70,8 @@ 
                              (lex.infile, lex.lineno, listname, name))
                 return 1
             return 0
-        lex = shlex.shlex(open(path, 'rb'), path, True)
-        lex.wordchars += '!@#$%^&*()-=+[]{}|;:,./<>?'
+        lex = common.shlexer(
+            filepath=path, wordchars='!@#$%^&*()-=+[]{}|;:,./<>?')
         cmd = lex.get_token()
         while cmd:
             if cmd == 'include':