Merge lp:~fjalvingh/bzr-xmloutput/expose-bugs-property into lp:bzr-xmloutput

Proposed by Frits Jalvingh
Status: Needs review
Proposed branch: lp:~fjalvingh/bzr-xmloutput/expose-bugs-property
Merge into: lp:bzr-xmloutput
Diff against target: 30 lines (+20/-0)
1 file modified
logxml.py (+20/-0)
To merge this branch: bzr merge lp:~fjalvingh/bzr-xmloutput/expose-bugs-property
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Needs Fixing
Guillermo Gonzalez Needs Information
Review via email: mp+16318@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Frits Jalvingh (fjalvingh) wrote :

This exposes the Bazaar 'bugs' property in the xmllog command. This property contains a list of bugtracker URLs for issues that were marked as fixed during commits using the --fixes option.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi, sorry for the delay.

The code looks ok, but I'ld like to have an option to show the bugs property (or to not show them ;-))

Do you think you can add a --show-bugs option to xmllog and leave it on by default for log --xml?

Also, what do you think about not adding the <status> tag if there is no status (status == '')?

Thanks.

review: Needs Information
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Needs Fixing (code)

Unmerged revisions

140. By Frits Jalvingh

Expose the 'bugs' property in bzr xmllog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'logxml.py'
2--- logxml.py 2009-07-02 16:12:44 +0000
3+++ logxml.py 2009-12-18 00:58:11 +0000
4@@ -139,6 +139,26 @@
5 for tag in revision.tags:
6 self.to_file.write('<tag>%s</tag>' % tag)
7 self.to_file.write('</tags>')
8+ # jal@etc.to expose 'bugs' property
9+ if revision.rev.properties and 'bugs' in revision.rev.properties:
10+ bugs = revision.rev.properties['bugs']
11+ if len(bugs) > 0:
12+ self.to_file.write('<bugs>')
13+ bugar = bugs.split('\n')
14+ for bug in bugar:
15+ if len(bug) > 0:
16+ self.to_file.write('<bug>')
17+ lsp = bug.rfind(' ')
18+ if lsp == -1:
19+ url = bug
20+ status = ''
21+ else:
22+ url = bug[0:lsp].rstrip()
23+ status = bug[lsp+1:].strip()
24+ self.to_file.write('<url>%s</url>' % url)
25+ self.to_file.write('<status>%s</status>' % status)
26+ self.to_file.write('</bug>')
27+ self.to_file.write('</bugs>')
28 if self.show_ids:
29 self.to_file.write('<revisionid>%s</revisionid>' %
30 revision.rev.revision_id)

Subscribers

People subscribed via source and target branches

to all changes: