diff mercurial/rewriteutil.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 57875cf423c9
children a391d0710f22
line wrap: on
line diff
--- a/mercurial/rewriteutil.py	Sun Oct 06 09:45:02 2019 -0400
+++ b/mercurial/rewriteutil.py	Sun Oct 06 09:48:39 2019 -0400
@@ -17,29 +17,29 @@
 )
 
 
-def precheck(repo, revs, action='rewrite'):
+def precheck(repo, revs, action=b'rewrite'):
     """check if revs can be rewritten
     action is used to control the error message.
 
     Make sure this function is called after taking the lock.
     """
     if node.nullrev in revs:
-        msg = _("cannot %s null changeset") % action
-        hint = _("no changeset checked out")
+        msg = _(b"cannot %s null changeset") % action
+        hint = _(b"no changeset checked out")
         raise error.Abort(msg, hint=hint)
 
     if len(repo[None].parents()) > 1:
-        raise error.Abort(_("cannot %s while merging") % action)
+        raise error.Abort(_(b"cannot %s while merging") % action)
 
-    publicrevs = repo.revs('%ld and public()', revs)
+    publicrevs = repo.revs(b'%ld and public()', revs)
     if publicrevs:
-        msg = _("cannot %s public changesets") % action
-        hint = _("see 'hg help phases' for details")
+        msg = _(b"cannot %s public changesets") % action
+        hint = _(b"see 'hg help phases' for details")
         raise error.Abort(msg, hint=hint)
 
     newunstable = disallowednewunstable(repo, revs)
     if newunstable:
-        raise error.Abort(_("cannot %s changeset with children") % action)
+        raise error.Abort(_(b"cannot %s changeset with children") % action)
 
 
 def disallowednewunstable(repo, revs):
@@ -52,4 +52,4 @@
     allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
     if allowunstable:
         return revset.baseset()
-    return repo.revs("(%ld::) - %ld", revs, revs)
+    return repo.revs(b"(%ld::) - %ld", revs, revs)