This hgrc configuration results in an abort message because the scheme wbackslash ends in a backslash: [extensions] schemes = [schemes] wbackslash = G:\bla\ Failure message (doing all config in one command): C:\Users\tests>hg --config extensions.schemes= --config schemes.wbackslash=G:\bla\ id wbackslash://path/to/ ** http://mercurial.selenic.com/wiki/BugTracker ** Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] ** Mercurial Distributed SCM (Version 3.5+5) ** Erweiterungen geladen: schemes Traceback (most recent call last): File "hg", line 49, in <module> File "mercurial\dispatch.pyo", line 30, in run File "mercurial\dispatch.pyo", line 92, in dispatch File "mercurial\dispatch.pyo", line 163, in _runcatch File "mercurial\dispatch.pyo", line 895, in _dispatch File "mercurial\dispatch.pyo", line 656, in runcommand File "mercurial\dispatch.pyo", line 1013, in _runcommand File "mercurial\dispatch.pyo", line 982, in checkargs File "mercurial\dispatch.pyo", line 892, in <lambda> File "mercurial\util.pyo", line 792, in check File "mercurial\commands.pyo", line 4027, in identify File "mercurial\hg.pyo", line 146, in peer File "mercurial\hg.pyo", line 123, in _peerorrepo File "hgext\schemes.pyo", line 80, in instance File "mercurial\templater.pyo", line 759, in process File "mercurial\templater.pyo", line 752, in _load File "mercurial\templater.pyo", line 174, in compiletemplate File "mercurial\templater.pyo", line 150, in _parsetemplate ValueError: Trailing \ in string Maybe the failure is expected, but the message does not tell a lot of useful information.
*** Bug 4799 has been marked as a duplicate of this bug. ***
It is indeed expected: the value is treated as a Mercurial template, and thus \ is an escape character. Degrading to wish/feature: we should improve the error message and the docs. FYI, the error comes from Python: >>> "blah\\".decode('string-escape') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Trailing \ in string
Fixed by https://selenic.com/repo/hg/rev/72aad184f061 Matt Mackall <mpm@selenic.com> templater: create string unescape helper (issue4798) This gives us a unified place to do error-handling of string-escaping syntax errors (please test the fix)