[MERGE][#295161] Ensure valid messages and revision properties

John Arbash Meinel john at arbash-meinel.com
Tue Nov 18 18:11:59 GMT 2008

Hash: SHA1

Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> At the moment, we have a small issue with how we (de)serialize commit
>> messages and revision properties because we go through XML.
>> Specifically, when writing, we are allowed to write things like "\r" and
>> "\r\n" to the string, but when those strings get read back, they will
>> all be normalized to "\n". (This happens as part of the Expat parsing.)
> To be clear: you want to forbid \r both in XML markup and in XML tag
> bodies?  That seems to impair our ability to do lossless conversions.
> Aaron

To be fair, if we have "\r" in the xml content, we don't know about it,
because Expat filters it out for us.

So by the time we have Revision.message we have already lost the info.

The idea with this patch is to just prevent it from getting in there in
the first place. As it stands, it does get put into the bytes in the
repository, we just never see it outside of there. And if we ever got
bytes => Revision => reserialized
then we actually corrupt the bytes in the repository because going back
again would not be lossless.

The idea is that if we ever have a repository format which isn't
lossless (say by using a different format with a less-lossy parser) then
that Repository can remove the restriction.

Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list