mercurial/commands.py
changeset 46794 e2f7b2695ba1
parent 46778 066b8d8f75b8
parent 46699 184e0ae0a4b2
child 46798 f51ff655d338
--- a/mercurial/commands.py	Tue Mar 02 00:05:22 2021 +0100
+++ b/mercurial/commands.py	Thu Mar 18 18:24:59 2021 -0400
@@ -1083,7 +1083,7 @@
         if rev:
             if not nodes:
                 raise error.Abort(_(b'empty revision set'))
-            node = repo[nodes.last()].node()
+            node = repo[nodes[-1]].node()
         with hbisect.restore_state(repo, state, node):
             while changesets:
                 # update state
@@ -3452,7 +3452,8 @@
         regexp = util.re.compile(pattern, reflags)
     except re.error as inst:
         ui.warn(
-            _(b"grep: invalid match pattern: %s\n") % pycompat.bytestr(inst)
+            _(b"grep: invalid match pattern: %s\n")
+            % stringutil.forcebytestr(inst)
         )
         return 1
     sep, eol = b':', b'\n'