[PATCH 3 of 5] py3: manually escape control character to be embedded in win filename error

Yuya Nishihara yuya at tcha.org
Wed Sep 27 08:34:40 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1506507088 -32400
#      Wed Sep 27 19:11:28 2017 +0900
# Node ID 1f783de54c8cce12807b92f41a670d16fbbad6aa
# Parent  40669eaa31e2c2371481fc50f7ed725b17063f6e
py3: manually escape control character to be embedded in win filename error

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1284,8 +1284,8 @@ def checkwinfilename(path):
                 return _("filename contains '%s', which is reserved "
                          "on Windows") % c
             if ord(c) <= 31:
-                return _("filename contains %r, which is invalid "
-                         "on Windows") % c
+                return _("filename contains '%s', which is invalid "
+                         "on Windows") % escapestr(c)
         base = n.split('.')[0]
         if base and base.lower() in _winreservednames:
             return _("filename contains '%s', which is reserved "


More information about the Mercurial-devel mailing list