Comment 4 for bug 196218

Revision history for this message
Markus Korn (thekorn) wrote :

this patch against .main rev 70 adds a read-only attribute ".branches" to a Bug object in the html-mode.
'Bug.branches' is a set-like object

Example Use-case:

In [1]: import launchpadbugs.connector as Connector

In [2]: Bug = Connector.ConnectBug()
^[[A
In [3]: b = Bug(137574)

In [4]: b.branches
Out[4]: Branches([BzrBranch(~thekorn/python-launchpad-bugs/main.diffscripts, https://code.launchpad.net/~thekorn/python-launchpad-bugs/main.diffscripts, Abandoned), BzrBranch(~thekorn/python-launchpad-bugs/fixing.commit, https://code.launchpad.net/~thekorn/python-launchpad-bugs/fixing.commit, New)])

In [5]: a = b.branches.pop()

In [6]: a
Out[6]: BzrBranch(~thekorn/python-launchpad-bugs/main.diffscripts, https://code.launchpad.net/~thekorn/python-launchpad-bugs/main.diffscripts, Abandoned)

In [7]: print a
BzrBranch(~thekorn/python-launchpad-bugs/main.diffscripts, https://code.launchpad.net/~thekorn/python-launchpad-bugs/main.diffscripts, Abandoned)

In [8]: a.status
Out[8]: 'Abandoned'

In [9]: a.url
Out[9]: 'https://code.launchpad.net/~thekorn/python-launchpad-bugs/main.diffscripts'

Please test this patch, beeing able to add add/remove branches would be nice but is IMO not that urgent.

Markus