need query interface to bzr revisions
Bug #800490 reported by
Mark Atwood
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 |
To post a comment you must log in.
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() library_ state.BzrLibrar yState object at 0x319e910>
Out[4]: <bzrlib.
In [6]: import bzrlib. plugins. launchpad
In [7]: b = branch. Branch. open('lp:bzr')
In [8]: b.lock_read() lt(<bound method RemoteBranch.unlock of RemoteBranch( bzr+ssh: //bazaar. launchpad. net/%2Bbranch/ bzr/)>)
Out[8]: LogicalLockResu
In [9]: last_rev = b.las revision_ info
b.last_revision b.last_
In [10]: b.last_ revision_ info()
Out[10]: (6001, '<email address hidden>')
In [11]: wt = b.repository. revision_ tree(b. last_revision( )) ionTree instance at 3b33a90, <email address hidden>'>
72kB 135kB/s -
In [12]: wt
Out[12]: <InventoryRevis
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)'