Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 1233  / 1 Year ago, sat, february 11, 2023, 7:54:32

If you visit a project on Launchpad, you can see all active branches of all developers involved in the project.



Is there a bzr command to do the same without visiting the project's page on Launchpad in a browser?


More From » launchpad

 Answers
3

I don't know of any bzr command that does this, but it's actually very easy to script using the Launchpad python API. For instance:



#!/usr/bin/env python
import os, sys
from launchpadlib.launchpad import Launchpad

cachedir = os.path.expanduser("~/.launchpadlib/cache/")
launchpad = Launchpad.login_anonymously('find_branches',
'production',
cachedir)

try:
project = launchpad.projects[sys.argv[1]]
for b in project.getBranches():
if b.lifecycle_status not in ["Abandoned", "Merged"]:
print b.bzr_identity
except KeyError:
print "Project unknown...
Usage: " + sys.argv[0] + " lp_project_name"


So with python find_branches.py deluge we get:



lp:deluge
lp:~vcs-imports/deluge/trunk
lp:~mvoncken/deluge/ajax-template-dev
lp:~deluge-team/deluge/master
lp:~shaohao/deluge/0.9
lp:~damoxc/deluge/master


You can run wild with it and do things like sort by date_created, date_last_modified, or create your own heuristic for what branches are interesting to you. See:



https://launchpad.net/+apidoc/1.0.html#branch


[#32427] Sunday, February 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teromato

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
1 Year ago
;