Commit 49fb93c1 authored by dbeam@chromium.org's avatar dbeam@chromium.org

Remove --milestone to force engineers to double-check with TPMs for branch number.

BUG=304943

Review URL: https://chromiumcodereview.appspot.com/26280004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@227348 0039d316-1c4b-4281-b951-d872f2087c98
parent bb050f61
...@@ -3,14 +3,11 @@ ...@@ -3,14 +3,11 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import collections
import datetime import datetime
import json
import optparse import optparse
import os import os
import re import re
import sys import sys
import urllib2
import urlparse import urlparse
import breakpad # pylint: disable=W0611 import breakpad # pylint: disable=W0611
...@@ -30,10 +27,6 @@ Valid parameters: ...@@ -30,10 +27,6 @@ Valid parameters:
--merge <revision> --branch <branch_num> --merge <revision> --branch <branch_num>
Example: %(app)s --merge 12345 --branch 187 Example: %(app)s --merge 12345 --branch 187
[Merge from trunk to milestone]
--merge <revision> --milestone <milestone_num>
Example: %(app)s --merge 12345 --milestone 16
[Merge from trunk to local copy] [Merge from trunk to local copy]
--merge <revision> --local --merge <revision> --local
Example: %(app)s --merge 12345 --local Example: %(app)s --merge 12345 --local
...@@ -370,53 +363,6 @@ def getAllFilesInRevision(files_info): ...@@ -370,53 +363,6 @@ def getAllFilesInRevision(files_info):
return ['%s/%s' % (f[2], f[3]) for f in files_info] return ['%s/%s' % (f[2], f[3]) for f in files_info]
def getBranchForMilestone(milestone):
"""Queries omahaproxy.appspot.com for the branch number given |milestone|.
"""
OMAHA_PROXY_URL = "https://omahaproxy.appspot.com/all?json=1"
try:
response = urllib2.urlopen(OMAHA_PROXY_URL)
except urllib2.HTTPError, e:
print "Failed to query %s: %d" % (OMAHA_PROXY_URL, e.code)
return None
# Response is in the form of:
# [{ os: "os_name", versions: [{ channel: "canary", true_branch: "1490" }] }]
os_versions = json.load(response)
branches = collections.defaultdict(list)
for os_version in os_versions:
for version in os_version['versions']:
if not version['true_branch'] or not version['version']:
continue
branch = version['true_branch']
mstone = version['version'].split('.')
if not branch[0].isdigit() or mstone[0] != str(milestone):
continue
branches[branch] += [os_version['os']]
if not branches:
return None
if len(branches) == 1:
return branches.keys()[0]
choices = ('-(%s): %s' % (b, ', '.join(o)) for b, o in branches.iteritems())
print >> sys.stderr, ("\nNot all platforms have same branch number for M%d.\n"
"\nHere's a list of platforms on each branch:\n"
"%s") % (milestone, '\n'.join(choices))
errors = 0
while errors < 3:
user_input = raw_input("Which branch? ('q' to cancel) ").strip().lower()
if user_input in branches:
return user_input
if user_input.startswith('q'):
break
errors += 1
return None
def getSVNAuthInfo(folder=None): def getSVNAuthInfo(folder=None):
"""Fetches SVN authorization information in the subversion auth folder and """Fetches SVN authorization information in the subversion auth folder and
returns it as a dictionary of dictionaries.""" returns it as a dictionary of dictionaries."""
...@@ -487,12 +433,6 @@ def drover(options, args): ...@@ -487,12 +433,6 @@ def drover(options, args):
PROMPT_FOR_AUTHOR = False PROMPT_FOR_AUTHOR = False
NO_ALT_URLS = options.no_alt_urls NO_ALT_URLS = options.no_alt_urls
# Translate a given milestone to the appropriate branch number.
if options.milestone:
options.branch = getBranchForMilestone(options.milestone)
if not options.branch:
return 1
DEFAULT_WORKING = "drover_" + str(revision) DEFAULT_WORKING = "drover_" + str(revision)
if options.branch: if options.branch:
DEFAULT_WORKING += ("_" + options.branch) DEFAULT_WORKING += ("_" + options.branch)
...@@ -665,8 +605,6 @@ def main(): ...@@ -665,8 +605,6 @@ def main():
help='Revision to merge from trunk to branch') help='Revision to merge from trunk to branch')
option_parser.add_option('-b', '--branch', option_parser.add_option('-b', '--branch',
help='Branch to revert or merge from') help='Branch to revert or merge from')
option_parser.add_option('-M', '--milestone', type="int",
help='Milestone to revert or merge from')
option_parser.add_option('-l', '--local', action='store_true', option_parser.add_option('-l', '--local', action='store_true',
help='Local working copy to merge to') help='Local working copy to merge to')
option_parser.add_option('-s', '--sbranch', option_parser.add_option('-s', '--sbranch',
...@@ -692,19 +630,12 @@ def main(): ...@@ -692,19 +630,12 @@ def main():
option_parser.error("You need at least --merge or --revert") option_parser.error("You need at least --merge or --revert")
return 1 return 1
if options.merge and not (options.branch or options.milestone or if options.merge and not (options.branch or options.local):
options.local): option_parser.error("--merge requires --branch or --local")
option_parser.error("--merge requires either --branch "
"or --milestone or --local")
return 1
if options.local and (options.revert or options.branch or options.milestone):
option_parser.error("--local cannot be used with --revert "
"or --branch or --milestone")
return 1 return 1
if options.branch and options.milestone: if options.local and (options.revert or options.branch):
option_parser.error("--branch cannot be used with --milestone") option_parser.error("--local cannot be used with --revert or --branch")
return 1 return 1
return drover(options, args) return drover(options, args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment