Add 'bugs' property to xmllog?
Frits Jalvingh
jal at etc.to
Sun Dec 6 11:11:26 GMT 2009
Hello,
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)
More information about the bazaar
mailing list