[Bug 5504] New: hg log --encoding utf-8 -t "{join(extras,';')\n" returns non-UTF-8 characters
mercurial-bugs at mercurial-scm.org
mercurial-bugs at mercurial-scm.org
Tue Mar 14 11:35:50 UTC 2017
https://bz.mercurial-scm.org/show_bug.cgi?id=5504
Bug ID: 5504
Summary: hg log --encoding utf-8 -t "{join(extras,';')\n"
returns non-UTF-8 characters
Product: Mercurial
Version: 4.1.1
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: bug
Priority: normal
Component: Mercurial
Assignee: bugzilla at mercurial-scm.org
Reporter: gabor.stefanik at nng.com
CC: mercurial-devel at mercurial-scm.org
The log templater treats the "extras" dict of a revision as containing binary
data. Whenever there is something unprintable in it, {extras} causes such bytes
to be printed using Python string-escape syntax.
However, {join(extras,';')} (and basically anything that pushes extras through
a function) doesn't perform the same encoding, and will directly print
unencoded and unescaped bytes from the "extras" dict. As a result, hg log
--encoding X -t {join(extras,';')} may generate output that can't be decoded
using a strict decoder for X.
This makes e.g. SCM Manager (which uses a Hg command server to execute log
commands with a template that references extras) malfunction on repositories
that contain binary data in the extras field of a commit. An example of how
binary data may end up in extras appears to be hg-git.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list