Patchwork [7,of,8] py3: remove b'' from error message of disallowed filename

login
register
mail settings
Submitter Yuya Nishihara
Date June 16, 2018, 11:06 a.m.
Message ID <bc71920694ff3bb072da.1529147173@mimosa>
Download mbox | patch
Permalink /patch/32193/
State Accepted
Headers show

Comments

Yuya Nishihara - June 16, 2018, 11:06 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1529139397 -32400
#      Sat Jun 16 17:56:37 2018 +0900
# Node ID bc71920694ff3bb072daff3751a57ede528fcb8b
# Parent  f701eb1d33ae7b9526742315b4f1d375ec016574
py3: remove b'' from error message of disallowed filename

Patch

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -127,6 +127,7 @@  test-eol-patch.t
 test-eol-tag.t
 test-eol-update.t
 test-eol.t
+test-eolfilename.t
 test-excessive-merge.t
 test-exchange-obsmarkers-case-A1.t
 test-exchange-obsmarkers-case-A2.t
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -20,6 +20,7 @@  from . import (
     error,
     mdiff,
     policy,
+    pycompat,
     revlog,
     util,
 )
@@ -635,7 +636,8 @@  def _checkforbidden(l):
     for f in l:
         if '\n' in f or '\r' in f:
             raise error.RevlogError(
-                _("'\\n' and '\\r' disallowed in filenames: %r") % f)
+                _("'\\n' and '\\r' disallowed in filenames: %r")
+                % pycompat.bytestr(f))
 
 
 # apply the changes collected during the bisect loop to our addlist
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -287,7 +287,8 @@  def checknewlabel(repo, lbl, kind):
 def checkfilename(f):
     '''Check that the filename f is an acceptable filename for a tracked file'''
     if '\r' in f or '\n' in f:
-        raise error.Abort(_("'\\n' and '\\r' disallowed in filenames: %r") % f)
+        raise error.Abort(_("'\\n' and '\\r' disallowed in filenames: %r")
+                          % pycompat.bytestr(f))
 
 def checkportable(ui, f):
     '''Check if filename f is portable and warn or abort depending on config'''