testparseutil: escape backslash in docstring
This is funky. This inline Python code is part of a docstring, which
means the string is interpreted first. So any backslashes need double
escaping. So even though this is already a br'', we still need to escape.
Differential Revision: https://phab.mercurial-scm.org/D5842
--- a/contrib/testparseutil.py Mon Feb 04 14:14:25 2019 -0800
+++ b/contrib/testparseutil.py Mon Feb 04 14:16:52 2019 -0800
@@ -265,7 +265,7 @@
class fileheredocmatcher(embeddedmatcher):
"""Detect "cat > FILE << LIMIT" style embedded code
- >>> matcher = fileheredocmatcher(b'heredoc .py file', br'[^<]+\.py')
+ >>> matcher = fileheredocmatcher(b'heredoc .py file', br'[^<]+\\.py')
>>> b2s(matcher.startsat(b' $ cat > file.py << EOF\\n'))
('file.py', ' > EOF\\n')
>>> b2s(matcher.startsat(b' $ cat >>file.py <<EOF\\n'))