D7970: crecord: fix a concatenation of bytes and str on py3
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Thu Jan 23 07:33:19 EST 2020
Closed by commit rHG43410ec7462b: crecord: fix a concatenation of bytes and str on py3 (authored by spectral).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D7970?vs=19518&id=19537
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7970/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7970
AFFECTED FILES
mercurial/crecord.py
CHANGE DETAILS
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -24,6 +24,7 @@
encoding,
error,
patch as patchmod,
+ pycompat,
scmutil,
util,
)
@@ -1113,7 +1114,7 @@
# strip \n, and convert control characters to ^[char] representation
text = re.sub(
br'[\x00-\x08\x0a-\x1f]',
- lambda m: b'^' + chr(ord(m.group()) + 64),
+ lambda m: b'^' + pycompat.sysbytes(chr(ord(m.group()) + 64)),
text.strip(b'\n'),
)
To: spectral, #hg-reviewers, pulkit
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list