Patchwork D2263: py3: use "%d" to convert integers to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 14, 2018, 1:43 p.m.
Message ID <59c47cb46ac6b93c0e59d8701a55675a@localhost.localdomain>
Download mbox | patch
Permalink /patch/27923/
State Not Applicable
Headers show

Comments

phabricator - Feb. 14, 2018, 1:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGacc8e6e52af6: py3: use &quot;%d&quot; to convert integers to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2263?vs=5703&id=5717

REVISION DETAIL
  https://phab.mercurial-scm.org/D2263

AFFECTED FILES
  hgext/rebase.py
  hgext/shelve.py
  mercurial/verify.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -60,6 +60,7 @@ 
     def err(self, linkrev, msg, filename=None):
         if linkrev is not None:
             self.badrevs.add(linkrev)
+            linkrev = "%d" % linkrev
         else:
             linkrev = '?'
         msg = "%s: %s" % (linkrev, msg)
diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -271,7 +271,7 @@ 
             "activebook": activebook or cls._noactivebook
         }
         scmutil.simplekeyvaluefile(repo.vfs, cls._filename)\
-               .write(info, firstline=str(cls._version))
+               .write(info, firstline=("%d" % cls._version))
 
     @classmethod
     def clear(cls, repo):
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -541,7 +541,7 @@ 
                                   'to commit\n') % (rev, ctx))
                         self.skipped.add(rev)
                     self.state[rev] = p1
-                    ui.debug('next revision set to %s\n' % p1)
+                    ui.debug('next revision set to %d\n' % p1)
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))