changeset 46700:279edaaea711 stable

crecord: change str literals to byte literals Differential Revision: https://phab.mercurial-scm.org/D10202
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 12 Mar 2021 18:51:22 -0500
parents 184e0ae0a4b2
children c6d9948e865f
files mercurial/crecord.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/crecord.py	Fri Mar 12 17:59:02 2021 -0500
+++ b/mercurial/crecord.py	Fri Mar 12 18:51:22 2021 -0500
@@ -34,14 +34,14 @@
 
 # patch comments based on the git one
 diffhelptext = _(
-    """# To remove '-' lines, make them ' ' lines (context).
+    b"""# To remove '-' lines, make them ' ' lines (context).
 # To remove '+' lines, delete them.
 # Lines starting with # will be removed from the patch.
 """
 )
 
 hunkhelptext = _(
-    """#
+    b"""#
 # If the patch applies cleanly, the edited hunk will immediately be
 # added to the record list. If it does not apply cleanly, a rejects file
 # will be generated. You can use that when you try again. If all lines
@@ -51,7 +51,7 @@
 )
 
 patchhelptext = _(
-    """#
+    b"""#
 # If the patch applies cleanly, the edited patch will immediately
 # be finalised. If it does not apply cleanly, rejects files will be
 # generated. You can use those when you try again.
@@ -611,7 +611,8 @@
 
     chunkselector.stdscr = dummystdscr()
     if testfn and os.path.exists(testfn):
-        testf = open(testfn, 'r')
+        testf = open(testfn, b'r')
+        # TODO: open in binary mode?
         testcommands = [x.rstrip('\n') for x in testf.readlines()]
         testf.close()
         while True:
@@ -1621,7 +1622,7 @@
     def helpwindow(self):
         """print a help window to the screen.  exit after any keypress."""
         helptext = _(
-            """            [press any key to return to the patch-display]
+            b"""            [press any key to return to the patch-display]
 
 The curses hunk selector allows you to interactively choose among the
 changes you have made, and confirm only those changes you select for
@@ -1745,7 +1746,7 @@
         """ask for 'y' to be pressed to confirm selected. return True if
         confirmed."""
         confirmtext = _(
-            """If you answer yes to the following, your currently chosen patch chunks
+            b"""If you answer yes to the following, your currently chosen patch chunks
 will be loaded into an editor. To modify the patch, make the changes in your
 editor and save. To accept the current patch as-is, close the editor without
 saving.