Add 'bugs' property to xmllog?

Jelmer Vernooij jelmer at samba.org
Sun Dec 6 12:41:19 GMT 2009


Hi Frits,

On Sun, 2009-12-06 at 12:11 +0100, Frits Jalvingh wrote: 
> I want to be able to access the 'bugs' property on all revisions that were 
> committed with a --fixes option. I want to have that to be able to associate 
> commits with bugs in my bug tracker/fix builder when fix branches are pushed 
> to it.
> 
> I could not find any existing way to expose that property - bzr cat-revision 
> shows it in some serialized format that I could decode but that seems fragile.
> 
> So I made a small change to the bzr-xmloutput plugin's xmllog command to force 
> it to output the value of that bugs property if available, so that it can be 
> read easily from software. 
> 
> It would of course be great if this could be incorporated in that plugin; in 
> the meantime perhaps this change would be useful for other people (and can 
> probably be found when googling ;-)
> 
> The trivial change diff:
> 
> jal at cluny:~/.bazaar/plugins/xmloutput$ bzr diff logxml.py
> === modified file 'logxml.py'
> --- logxml.py   2009-07-02 16:12:44 +0000
> +++ logxml.py   2009-12-05 00:05:32 +0000
> @@ -139,6 +139,8 @@
>              for tag in revision.tags:
>                  self.to_file.write('<tag>%s</tag>' % tag)
>              self.to_file.write('</tags>')
> +        if revision.rev.properties and 'bugs' in revision.rev.properties:
> +            self.to_file.write('<bugs>%s</bugs>' % 
> _escape_cdata(revision.rev.properties['bugs']))
>          if self.show_ids:
>              self.to_file.write('<revisionid>%s</revisionid>' %
>                                  revision.rev.revision_id)
This seems like a good idea. I think it would be nice if we could
provide the contents of the bugs property in XML as well rather than
just providing the plain contents, to prevent the user from having to
implement a parser for the bugs property themselves.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20091206/8f31ba23/attachment.pgp 


More information about the bazaar mailing list