Code review comment for lp:~guilhem-bichot/bzr/bzr-pull-verbose-shows-tip-before-pull

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

GuilhemBichot wrote:
> I merged your changes, removed "result = None", changed the printing order (not yet ran the testsuite and not yet committed); regarding this comment:
> # Encode target because it may have non-ascii characters, and
> # so can the revids.
> target = target.encode('utf-8')
> A simple test says that before running "encode()", target is a unicode string (ok) but result.(old|new)_revid are str. So maybe "so can the revids" should be removed? On the other hand, if it is really a correct comment, shouldn't there be an encode() on those revids before printing them?

Revision ids are defined as utf-8 encoded strings. (*never* unicode.) So
we don't want to mix non-ascii utf-8 strings with Unicode as it causes
python to try to decode them as ascii. (Now it turns out that in
practice 99% of all revision-ids are pure ascii, but that isn't the api
definition.)

So the comment stands. :)

mutter() is taking them as 8-bit (utf-8) strings, which should be fine.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksewRsACgkQJdeBCYSNAANJ7QCffD27+go9zaJtCQlTlu+O2PbC
kykAnRieLvBtdH8WApDFN48Q/aBhDAnu
=2K6c
-----END PGP SIGNATURE-----

« Back to merge proposal