← Back to team overview

ubuntu-phone team mailing list archive

Re: ANN: Changes to our Upstream Landing and Merge Review Practices in January

 

On Thu, 2014-01-09 at 08:34 +0100, Didier Roche wrote:

> (I wish we can enforce maintenance branch around 
> lp:foo/<distro_version>, but I guess I'll save the debate for later ;))


For those who are interested I attached my script that we use to do
this.  It makes it easy and makes Didier smile, best script in the
world!


        $ lp-project-new-series indicator-location 14.10 14.04


I use it with a list of all our projects and xargs when I go to lunch
one day.

Ted

#!/usr/bin/python

from launchpadlib.launchpad import Launchpad
import sys
import os

if len(sys.argv) != 4 and len(sys.argv) != 3:
	print >> sys.stderr, '''List the series on a project:

usage: %s <project name> <new series> [old series]''' % sys.argv[0] 
	sys.exit(1) 

project_name = sys.argv[1]
new_branch_name = None

launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
project = launchpad.projects[project_name]

if project is None:
	print >> sys.stderr, "Unable to find project: %s" % (project_name)
	sys.exit(1)

if len(sys.argv) == 4:
	old_series = project.getSeries(name=sys.argv[3])
	if old_series is None:
		print >> sys.stderr, "Unable to find series: %s" % (sys.argv[3])
		sys.exit(1)

	if old_series.branch is not None:
		new_branch_name = "~%s/%s/trunk.%s" % (old_series.branch.owner.name, sys.argv[1], sys.argv[2])
		print "Copying branch '%s' to 'lp:%s'" % (old_series.branch.bzr_identity, new_branch_name)
		os.system("bzr branch %s lp:%s" % (old_series.branch.bzr_identity, new_branch_name))

		if old_series.branch.lifecycle_status is not "Mature":
			print "Setting status of branch '%s' from '%s' to 'Mature'" % (old_series.branch.bzr_identity, old_series.branch.lifecycle_status)
			print "  (broken)"
			#old_series.branch.lifecycle_status = 'Mature'
			#old_series.branch.lp_save()

	if old_series.status is not 'Current Stable Release':
		print "Changing series %s from '%s' to 'Current Stable Release'" % (sys.argv[3], old_series.status)
		old_series.status = 'Current Stable Release'
		old_series.lp_save()

if new_branch_name is not None:
	new_series = project.newSeries(name=sys.argv[2], branch="https://api.launchpad.net/1.0/%s"%(new_branch_name), summary="New series")
else:
	new_series = project.newSeries(name=sys.argv[2], summary="New series")

if new_series is None:
	print >> sys.stderr, "Unable to create new series: %s" % (sys.argv[2])
	sys.exit(1)

project.development_focus = new_series
project.lp_save()

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References