Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 30678:caf7e1c5efe4
py3: have a bytes version of shlex.split()
shlex.split() only accepts unicodes on Python 3. After this patch we will be
using pycompat.shlexsplit(). This patch also replaces existing occurences of
shlex.split with pycompat.shlexsplit.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 25 Dec 2016 03:06:55 +0530 |
parents | 10b17ed9b591 |
children | 8d46eaaa589c |
comparison
equal
deleted
inserted
replaced
30677:c80c16a8a0b0 | 30678:caf7e1c5efe4 |
---|---|
9 | 9 |
10 import difflib | 10 import difflib |
11 import errno | 11 import errno |
12 import os | 12 import os |
13 import re | 13 import re |
14 import shlex | |
15 import socket | 14 import socket |
16 import string | 15 import string |
17 import sys | 16 import sys |
18 import tempfile | 17 import tempfile |
19 import time | 18 import time |
1979 | 1978 |
1980 # editor | 1979 # editor |
1981 editor = ui.geteditor() | 1980 editor = ui.geteditor() |
1982 editor = util.expandpath(editor) | 1981 editor = util.expandpath(editor) |
1983 fm.write('editor', _("checking commit editor... (%s)\n"), editor) | 1982 fm.write('editor', _("checking commit editor... (%s)\n"), editor) |
1984 cmdpath = util.findexe(shlex.split(editor)[0]) | 1983 cmdpath = util.findexe(pycompat.shlexsplit(editor)[0]) |
1985 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', | 1984 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', |
1986 _(" No commit editor set and can't find %s in PATH\n" | 1985 _(" No commit editor set and can't find %s in PATH\n" |
1987 " (specify a commit editor in your configuration" | 1986 " (specify a commit editor in your configuration" |
1988 " file)\n"), not cmdpath and editor == 'vi' and editor) | 1987 " file)\n"), not cmdpath and editor == 'vi' and editor) |
1989 fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound', | 1988 fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound', |