need query interface to bzr revisions

Bug #800490 reported by Mark Atwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Need an API & UI that will find a tree and all associated metainformation, given a Bazaar object id.

Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Martin Pool (mbp) wrote :

Hi Mark,

You should be able to get this now using bzrlib; see for example <http://doc.bazaar.canonical.com/bzr.dev/developers/plugin-api.html>.

If you need something that you can't get there, or can't work out how to get there, or if you specifically need to get it through the Launchpad api rather than through bzr, please let us know.

Something like this should work:

In [1]: from bzrlib import branch

In [3]: import bzrlib

In [4]: bzrlib.initialize()
Out[4]: <bzrlib.library_state.BzrLibraryState object at 0x319e910>

In [6]: import bzrlib.plugins.launchpad

In [7]: b = branch.Branch.open('lp:bzr')

In [8]: b.lock_read()
Out[8]: LogicalLockResult(<bound method RemoteBranch.unlock of RemoteBranch(bzr+ssh://bazaar.launchpad.net/%2Bbranch/bzr/)>)

In [9]: last_rev = b.las
b.last_revision b.last_revision_info

In [10]: b.last_revision_info()
Out[10]: (6001, '<email address hidden>')

In [11]: wt = b.repository.revision_tree(b.last_revision())
    72kB 135kB/s -
In [12]: wt
Out[12]: <InventoryRevisionTree instance at 3b33a90, <email address hidden>'>

In [13]: rev = b.repository.get_revision(b.last_revision())
   320kB 218kB/s |

In [14]: rev.message
Out[14]: u'(mbp) remove __contains__ methods from inventory and dict (Martin Pool)'

Changed in launchpad:
status: Triaged → Incomplete
Revision history for this message
Robert Collins (lifeless) wrote :

@poolie I think you misread Marks' request. Given a revisionid, find all the trees on launchpad containing it.

Changed in launchpad:
status: Incomplete → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

ok, i see.

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.