mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-26 18:31:10 +00:00
Have an optional argument to create a new milestone on the series
This commit is contained in:
parent
1329a9338d
commit
d91afb44bb
@ -79,13 +79,13 @@ def edit_file(prefix, description):
|
|||||||
return content.strip()
|
return content.strip()
|
||||||
|
|
||||||
def main():
|
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.
|
print >> sys.stderr, '''Upload a release tarball to a Launchpad project.
|
||||||
|
|
||||||
Usage: %s <project name> <version> <tarball>''' % sys.argv[0]
|
Usage: %s <project name> <version> <tarball> [new milestone]''' % sys.argv[0]
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
(project, version, tarball) = sys.argv[1:]
|
(project, version, tarball, new_milestone) = sys.argv[1:]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
|
launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
|
||||||
@ -140,6 +140,18 @@ def main():
|
|||||||
|
|
||||||
release.lp_save()
|
release.lp_save()
|
||||||
|
|
||||||
|
if not new_milestone is None:
|
||||||
|
mil = release.milestone
|
||||||
|
for series in proj.series:
|
||||||
|
broke = False
|
||||||
|
for milestone in series.all_milestones:
|
||||||
|
if mil.name == milestone.name:
|
||||||
|
series.newMilestone(name=new_milestone, date_targeted=datetime.date.today().strftime('%Y-%m-%d'))
|
||||||
|
broke = True
|
||||||
|
break
|
||||||
|
if broke:
|
||||||
|
break
|
||||||
|
|
||||||
except HTTPError, error:
|
except HTTPError, error:
|
||||||
print 'An error happened in the upload:', error.content
|
print 'An error happened in the upload:', error.content
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user