Patchwork D2526: convcmd: use our shlex wrapper to avoid Python 3 tracebacks

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 11:22 p.m.
Message ID <differential-rev-PHID-DREV-2j5bcnztjnm5ocmyo57a-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28618/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 11:22 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/convert/convcmd.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -8,7 +8,6 @@ 
 
 import collections
 import os
-import shlex
 import shutil
 
 from mercurial.i18n import _
@@ -211,9 +210,7 @@ 
                     # Ignore blank lines
                     continue
                 # split line
-                lex = shlex.shlex(line, posix=True)
-                lex.whitespace_split = True
-                lex.whitespace += ','
+                lex = common.shlexer(data=line, whitespace=',')
                 line = list(lex)
                 # check number of parents
                 if not (2 <= len(line) <= 3):