Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.py @ 44023:6d3b67a837a6
cleanup: drop redundant character escapes from `[]` character sets
Flagged by PyCharm. Most special characters lose their special meaning inside
square brackets. The `-` in util.py doesn't need to be escaped because it is
the last character in the set.
Differential Revision: https://phab.mercurial-scm.org/D7766
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 28 Dec 2019 01:35:05 -0500 |
parents | e3ce3731d621 |
children | 5ac0e6f19eb4 |
line wrap: on
line diff
--- a/mercurial/ui.py Sat Dec 28 01:12:19 2019 -0500 +++ b/mercurial/ui.py Sat Dec 28 01:35:05 2019 -0500 @@ -1626,7 +1626,7 @@ # prompt to start parsing. Sadly, we also can't rely on # choices containing spaces, ASCII, or basically anything # except an ampersand followed by a character. - m = re.match(br'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt) + m = re.match(br'(?s)(.+?)\$\$([^$]*&[^ $].*)', prompt) msg = m.group(1) choices = [p.strip(b' ') for p in m.group(2).split(b'$$')]