Index: gce/uploader_helper.py |
diff --git a/gce/uploader_helper.py b/gce/uploader_helper.py |
index b6edb840661b64f04c9fab5ba22f634d25f48218..e7f71d25b6bab63d87567743a6270b644de7a70b 100755 |
--- a/gce/uploader_helper.py |
+++ b/gce/uploader_helper.py |
@@ -3,62 +3,10 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import StringIO |
import optparse |
import re |
import sys |
-def MakeBranchRevisionList(): |
- # Parse a list of SVN changes to extract revision numbers and branch names |
- # |
- # Input is the output of "svn log -qv", each record should look like this: |
- # |
- # ------------------------------------------------------------------------ |
- # r151821 | someone@chromium.org | 2013-06-05 10:08:51 +0100 (Wed, 05 Jun 2013) |
- # Changed paths: |
- # M /trunk/... |
- # |
- # or M /branches/chromium/1234/... |
- # |
- # Output is a '\n'-separated list of <branch>@<revision> pairs. The order of |
- # revisions is unaltered. |
- branches_and_revisions = [] |
- while True: |
- line = sys.stdin.readline() |
- if len(line) == 0: |
- return '' |
- if line.startswith('--------'): |
- break |
- while True: |
- revision_entry = '' |
- while True: |
- line = sys.stdin.readline() |
- if len(line) == 0: |
- revision_entry = None |
- break |
- if line.startswith('--------'): |
- break |
- revision_entry += line |
- if not revision_entry: |
- break |
- match = re.search('r(\d+).*Changed paths[^/]*([/].*)\n', revision_entry, re.DOTALL) |
- if match: |
- revision = int(match.group(1)) |
- path = match.group(2) |
- branch = None |
- if path.startswith('/trunk'): |
- branch = '/trunk' |
- elif path.startswith('/branches/chromium'): |
- match = re.search('(/branches/chromium/\d+)', path) |
- if match: |
- branch = match.group(1) |
- if branch: |
- branches_and_revisions.append((branch, revision)) |
- out = StringIO.StringIO() |
- for rec in branches_and_revisions: |
- out.write('%s@%d\n' % (rec[0], rec[1])) |
- return out.getvalue() |
- |
class VarImpl(object): |
"""Implement the Var function used within the DEPS file.""" |
@@ -87,10 +35,6 @@ def FindProjectRevision(project_name): |
def main(): |
parser = optparse.OptionParser(usage='%prog [options]') |
parser.add_option( |
- '', '--make_branch_revision_list', |
- default=False, action='store_true', |
- help=('MakeBranchRevisionList')) |
- parser.add_option( |
'', '--find_project_revision', |
default=False, |
help=('FindProjectRevision')) |
@@ -98,9 +42,7 @@ def main(): |
if args: |
parser.print_help() |
return 1 |
- if options.make_branch_revision_list: |
- print MakeBranchRevisionList() |
- elif options.find_project_revision: |
+ if options.find_project_revision: |
print FindProjectRevision(options.find_project_revision) |
return 0 |