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

John Szakmeister john at szakmeister.net
Tue Jun 2 20:09:31 BST 2009

On Tue, Jun 2, 2009 at 1:51 PM, John Arbash Meinel
<john at arbash-meinel.com> wrote:
> 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 != ''.

Okay, so we should expect that .message be the empty string if there
is no message.

> 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.

I'll go ahead and add this too, for safety's sake even though it won't
be entirely necessary if .message is an empty string.

> 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:

Sounds great.  Thanks for the feedback John!


More information about the bazaar mailing list