diff --git a/debian/changelog b/debian/changelog index cd6368f..756398f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ubuntu-dev-tools (0.122) UNRELEASED; urgency=low + + [ Ted Gould ] + * lp-project-upload: Add an optional parameter for creating a new + milestone to add future bugs to. + + -- Ted Gould Tue, 19 Apr 2011 17:32:03 +0200 + ubuntu-dev-tools (0.121) unstable; urgency=low [ Daniel Holbach ] diff --git a/doc/lp-project-upload.1 b/doc/lp-project-upload.1 index fe0fa1c..16ade9f 100644 --- a/doc/lp-project-upload.1 +++ b/doc/lp-project-upload.1 @@ -4,7 +4,7 @@ lp\-project\-upload \- Upload a release tarball to a Launchpad project. .SH SYNOPSIS .B lp\-project\-upload -.I project-name version tarball +.I project-name version tarball [new milestone] .SH DESCRIPTION \fBlp\-project\-upload\fR uploads a tarball release of a project to Launchpad. diff --git a/lp-project-upload b/lp-project-upload index 2e1fcb3..b7ccb86 100755 --- a/lp-project-upload +++ b/lp-project-upload @@ -79,13 +79,16 @@ def edit_file(prefix, description): return content.strip() def main(): - if len(sys.argv) != 4: + if len(sys.argv) != 4 and len(sys.argv) != 5: print >> sys.stderr, '''Upload a release tarball to a Launchpad project. - Usage: %s ''' % sys.argv[0] + Usage: %s [new milestone]''' % sys.argv[0] sys.exit(1) - (project, version, tarball) = sys.argv[1:] + if len(sys.argv) == 4: + (project, version, tarball) = sys.argv[1:] + else: + (project, version, tarball, new_milestone) = sys.argv[1:] try: launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production') @@ -141,6 +144,13 @@ def main(): release.lp_save() + # Create a new milestone if requested + if new_milestone is not None: + mil = release.milestone + for series in proj.series: + if mil.name in [milestone.name for milestone in series.all_milestones]: + series.newMilestone(name=new_milestone) + except HTTPError, error: print 'An error happened in the upload:', error.content sys.exit(1)