Patchwork D3850: stringutil: update list of re-special characters to include &~

login
register
mail settings
Submitter phabricator
Date June 27, 2018, 2:21 p.m.
Message ID <differential-rev-PHID-DREV-bh6swyjuvym4r72jopd7-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32461/
State Superseded
Headers show

Comments

phabricator - June 27, 2018, 2:21 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I missed this because I was looking at the change that refactored
  re.escape, and these characters were added in
  https://github.com/python/cpython/commit/05cb728d68a278d11466f9a6c8258d914135c96c.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/utils/stringutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -25,7 +25,7 @@ 
 
 # regex special chars pulled from https://bugs.python.org/issue29995
 # which was part of Python 3.7.
-_respecial = pycompat.bytestr(b'()[]{}?*+-|^$\\.# \t\n\r\v\f')
+_respecial = pycompat.bytestr(b'()[]{}?*+-|^$\\.&~# \t\n\r\v\f')
 _regexescapemap = {ord(i): (b'\\' + i).decode('latin1') for i in _respecial}
 
 def reescape(pat):