Where does self.message get set on the Revision object?

John Arbash Meinel john at arbash-meinel.com
Tue Jun 2 18:51:31 BST 2009


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


...

>> But I'll comment that this Revision object has probably not been
>> serialized to disk. And my bet is that it is generated from something
>> like bzr-svn.
> 
> I believe I stated that initially, but yes, it's coming from bzr-svn.
> I ran the client directly against the Subversion repository (*the*
> Subversion repository), and ran into a commit that didn't have a log
> message.  If it's bzr-svn's fault (and it sounds like you're hinting
> that it is), then I can look to make the change there so that it
> provides a default empty message.  If it's truly expected that
> self.message can be None, get_summary() should definitely be updated,
> and depending on it's output, qbzr might need to be fixed to.  I'm
> just trying to figure out where I need to focus my energy. :-)
> 
> I'll definitely send submit a patch and a test for get_summary().  But
> if anyone knows the answer as to whether it's acceptable for .message
> to be None, I'll submit a patch to bzr-svn as well, if it's considered
> to be broken in that respect.
> 
> Thanks again!
> 
> -John
> 

1) bzrlib internals seem to always set Revision.message to the empty
string, rather than None
2) Everything but LineLogFormatter seems to wrap a:
  if not rev.message:
	# say something about "no message"
  else:
	message = XXX
Which means that they handle None or '' equally.
3) I don't really care whether Revision.message is None or ''. There at
least is an argument that bzr-svn => bzr => will end up as an empty
string, so arguably bzr-svn should encode that in the beginning.
Otherwise "SVNRevision == Revision" would fail because None != ''.

I would probably say that Revision.get_summary() should return an empty
string, and that LogLineFormatter should format that into "(no message)"
if it wants.

And thus QBzr can also format '' => (no message) or whatever other
string it wants to use. I prefer that to get_summary() doing the
formatting, because QBzr can then know if it is a truly empty message
and change to do something like use a grayed-out message for that
revision, etc. If you return "(no message)" then QBzr needs to guess
whether there is no message, or whether someone explictly chose to do:

  bzr commit -m "(no message)"

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

iEYEARECAAYFAkolZqMACgkQJdeBCYSNAANovQCgt4+PRrCZ9LVQWwvxhvBPakuM
Q6AAnRv+IM8HD2aZUCr47rhx2PO5Oibz
=YJeB
-----END PGP SIGNATURE-----



More information about the bazaar mailing list