This is an archive of the discontinued Mercurial Phabricator instance.

wireprotov2peer: rewrite character traversal to use slices
ClosedPublic

Authored by indygreg on Jan 25 2019, 7:01 PM.

Details

Summary

Otherwise on Python 3 we iterate over integers instead of a
bytes instance and the comparison fails.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Jan 25 2019, 7:01 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Jan 25 2019, 11:21 PM

+ mercurial/wireprotov2peer.py:307:
+ > self._ui.debug(_('received %r\n') % frame)
+ don't mark debug messages for translation
+ mercurial/wireprotov2peer.py:513:
+ > return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))]
+ missing whitespace in expression

yuja added a comment.Jan 26 2019, 2:10 AM
+  mercurial/wireprotov2peer.py:307:
+   >                 self._ui.debug(_('received %r\n') % frame)
+   don't mark debug messages for translation
+  mercurial/wireprotov2peer.py:513:
+   >     return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))]
+   missing whitespace in expression

Fixed these as I had to rebase the changesets.