Patchwork D2146: py3: port string formatting

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2018, 10:57 p.m.
Message ID <differential-rev-PHID-DREV-7ovddfgvyiupnqfv6n5d-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27594/
State Superseded
Headers show

Comments

phabricator - Feb. 11, 2018, 10:57 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  bytes() should be used over str() when the output is bytes.
  
  None doesn't cast to an empty string on Python 3. So use '' explicitly.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 12, 2018, 1:43 a.m.
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  `r` looks like an integer, and `bytes(int)` is `'\0' * int`.

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -289,7 +289,7 @@ 
                     skipped.add(old)
                 seen.add(new)
         repo.ui.debug('computed skipped revs: %s\n' %
-                        (' '.join(str(r) for r in sorted(skipped)) or None))
+                        (' '.join(bytes(r) for r in sorted(skipped)) or ''))
         repo.ui.debug('rebase status resumed\n')
 
         self.originalwd = originalwd