[merge] make RevisionSpec_revid always return a str
John Arbash Meinel
john at arbash-meinel.com
Sun Mar 11 15:49:07 GMT 2007
John Arbash Meinel has voted +1 (conditional).
Status is now: Conditionally approved
Comment:
I would change this to:
revision_id = self.spec
if isinstance(revision_id, unicode):
revision_id = revision_id.encode('utf-8')
# self.spec comes straight from parsing the command line arguments.
# So we expect it to be a Unicode string. Switch it to the internal
# representation.
revision_id = osutils.safe_revision_id(self.spec, warn=False)
At least for me safe_revision_id is meant to be so that the general code
doesn't have to know what the encoding is. And as long as there is a
comment as to why, warn=False can be passed.
If people don't prefer this, I suppose we can use a different idiom. Say
a different osutils function rather than a parameter to the existing
one.
For details, see:
http://bundlebuggy.aaronbentley.com/request/%3C20070309043232.GG3806%40cyclops.localdomain%3E
More information about the bazaar
mailing list