D4459: py3: make regexes in hgext/keyword.py bytes
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Tue Sep 4 12:29:56 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5bf99c27a7b6: py3: make regexes in hgext/keyword.py bytes (authored by pulkit, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4459?vs=10738&id=10749
REVISION DETAIL
https://phab.mercurial-scm.org/D4459
AFFECTED FILES
hgext/keyword.py
CHANGE DETAILS
diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -208,7 +208,7 @@
def _shrinktext(text, subfunc):
'''Helper for keyword expansion removal in text.
Depending on subfunc also returns number of substitutions.'''
- return subfunc(r'$\1$', text)
+ return subfunc(br'$\1$', text)
def _preselect(wstatus, changed):
'''Retrieves modified and added files from a working directory state
@@ -250,12 +250,12 @@
@util.propertycache
def rekw(self):
'''Returns regex for unexpanded keywords.'''
- return re.compile(r'\$(%s)\$' % self.escape)
+ return re.compile(br'\$(%s)\$' % self.escape)
@util.propertycache
def rekwexp(self):
'''Returns regex for expanded keywords.'''
- return re.compile(r'\$(%s): [^$\n\r]*? \$' % self.escape)
+ return re.compile(br'\$(%s): [^$\n\r]*? \$' % self.escape)
def substitute(self, data, path, ctx, subfunc):
'''Replaces keywords in data with expanded template.'''
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list