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: bugzi...@mercurial-scm.org
          Reporter: gabor.stefa...@nng.com
                CC: mercurial-devel@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.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to