No bug attribute for a bzr branch

Bug #196218 reported by Brian Murray
2
Affects Status Importance Assigned to Milestone
Bug Helper
Fix Released
Undecided
Brian Murray
python-launchpad-bugs
Fix Released
Medium
Markus Korn

Bug Description

1) main revno 70

It is a possible to associate a bzr branch with a bug report - for example bug 158175 - but python-launchpad-bugs has no knowledge that a branch exists. It would be useful if we could search for bugs with bzr branches as those fixes are easy to merge. After this feature exists in python-launchpad-bugs we should also add it to bugnumbers so it is more accessible.

Revision history for this message
Brian Murray (brian-murray) wrote :

html source from a bug with a branch:

    <h2>Related branches</h2>
  <div>
    <div class="bug-branch-summary">
      <a href="https://code.launchpad.net/~brian-murray/update-manager/bug.158175" title="~brian-murray/update-manager/bug.158175"><img src="/@@/branch" alt=""/>&nbsp;~brian-murray/update-manager/bug.158175</a>
      (<span class="branchstatusNEW">New</span>) -
      <a href="https://code.launchpad.net/~brian-murray/update-manager/bug.158175/+bug/158175/+edit"
         onclick="return switchBugBranchFormAndWhiteboard('494')">
        Fix Available
        <img src="/@@/expand" />
      </a>
    </div>
    <div style="display: none" id="bugbranch494">
      <dl><dd>
        <div>
    <form action="https://bugs.launchpad.net/~brian-murray/update-manager/bug.158175/+bug/158175/+bug-edit"
          name="launchpadform" method="post"
          enctype="multipart/form-data"
          accept-charset="UTF-8">
      <div>

Revision history for this message
Brian Murray (brian-murray) wrote :

branch information doesn't seem to exist in the +text version of the bug though and I reported this as bug 196222.

Changed in python-launchpad-bugs:
importance: Undecided → Medium
status: New → Confirmed
Changed in bughelper:
status: New → Confirmed
Revision history for this message
Markus Korn (thekorn) wrote :

Working on the py-lp-bugs part now

Changed in python-launchpad-bugs:
assignee: nobody → thekorn
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

Revision history for this message
Brian Murray (brian-murray) wrote :

I've tested the patch and merged it with main. Thanks!

Changed in python-launchpad-bugs:
status: Confirmed → Fix Released
Changed in bughelper:
assignee: nobody → brian-murray
status: Confirmed → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

bughelper (0.2.13) hardy; urgency=low

  [Brian Murray]
  * merged Markus's warning for people / team pages not having a +text
    interface (LP: #181307)
  * bugnumbers
    - added bugday output formatting
    - added filter for bugs with patches
    - added filter for bugs needing forwarding upstream
    - added filter for bugs resolved upstream
    - added filter for bugs with a related bzr branch (LP: #196218)

 -- Brian Murray <email address hidden> Sun, 09 Mar 2008 21:22:35 -0700

Changed in bughelper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.