annotate mozillatry.py @ 8:7423fa8b4343

wrong function name
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 04 Dec 2012 14:33:04 -0800
parents 51d1167cc684
children 8c8a223e4df2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 push patches to try
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
4
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
7 import configuration
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 import optparse
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 import os
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 import sys
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 from subprocess import check_call as call
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 def reset(directory):
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 """reset an hg directory to a good state"""
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 assert os.path.exists(directory) and os.path.isdir(directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 hg_dir = os.path.join(directory, '.hg')
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 assert os.path.exists(hg_dir) and os.path.isdir(hg_dir)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 call(['hg', 'revert', '--no-backup', '--all'], cwd=directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 call(['hg', 'qpop', '--all'], cwd=directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 try:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 shutil.rmtree(os.path.join(hg_dir, 'patches')) # remove patches
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 except:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 pass
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 def update(directory):
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 """update a mozilla-central checkout"""
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 assert os.path.exists(directory) and os.path.isdir(directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 reset(directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 call(['hg', 'pull'], cwd=directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 call(['hg', 'update'], cwd=directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 call(['hg', 'qinit'], cwd=directory)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 def push_to_try(patches, repo, commit, _try='ssh://hg.mozilla.org/try/'):
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 """push a series of patches to try repository"""
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 # ensure the repo is in a good state
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38 update(repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 try:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41 # apply patches
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 for patch in patches:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 call(['hg', 'qimport', patch], cwd=repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44 call(['hg', 'qpush', '--all'], cwd=repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45 call(['hg', 'qseries', '-v'], cwd=repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47 # push to try
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48 call(['hg', 'qref', '--message', commit], cwd=repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49 call(['hg', 'push', '-f', _try], cwd=repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50 finally:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
51 reset(repo)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
53 def try_syntax(opt=True, debug=True, unittests=('all'), talos=('all'), bug=None):
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54 """
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55 return try syntax; see also:
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
56 - https://github.com/pbiggar/trychooser
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
57 - http://trychooser.pub.build.mozilla.org/
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
58 """
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
59
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
60 assert opt or debug
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
61 message = ['try:']
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
62 message += ['-b', '%s%s' % (('d' if debug else ''), ('o' if opt else ''))]
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
63 message += ['-u', (','.join(unittests) if unittests else 'none')]
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
64 message += ['-t', (','.join(talos) if talos else 'none')]
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
65 if bug:
6
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
66 message += ['--post-to-bugzilla', 'Bug', str(bug)]
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
67 return ' '.join(message)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
68
7
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
69 ### configuration parsing
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
70
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
71 class ConfigurationError(Exception):
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
72 """error when checking configuration"""
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
73
4
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
74 class MozillaTryConfiguration(configuration.Configuration):
5
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
75
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
76 usage = '%prog [options] patch <patch2> <...>'
4
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
77 options = {'opt': {'default': True,
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
78 'help': "whether to try on opt builds"},
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
79 'debug': {'default': True,
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
80 'help': "whether to try on debug builds"},
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
81 'unittests': {'default': [],
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
82 'help': "unit tests to run",
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
83 'flags': ['-u', '--unittests']},
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
84 'talostests': {'default': [],
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
85 'help': "talos tests to run",
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
86 'flags': ['-t', '--talostests']},
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
87 'mozilla_central': {'help': "path to mozilla-central clone",
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
88 'required': True,
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
89 'flags': ["--m-c", "--mozilla-central"]}
14275dcbff10 begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
90 }
2
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
91
5
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
92 def __init__(self):
6
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
93 configuration.Configuration.__init__(self, usage=self.usage, load='--config')
5
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
94
8
7423fa8b4343 wrong function name
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
95 def validate(self):
5
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
96 """check configuration"""
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
97
8
7423fa8b4343 wrong function name
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
98 configuration.Configuration.validate(self)
7423fa8b4343 wrong function name
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
99
7423fa8b4343 wrong function name
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
100 if (not self.config.get('opt')) and (not self.config.get('debug')):
7
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
101 raise ConfigurationError("Must have opt or debug builds")
5
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
102
416f4562005c more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
103
2
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
104 def read_config(filename, options):
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
105 """read .mozutils config file and substitute for options if None"""
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
106
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
107 # XXX stub; this should really use
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
108 # e.g. http://k0s.org/mozilla/hg/configuration/
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
109 from ConfigParser import ConfigParser
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
110 parser = ConfigParser()
3
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
111 if not os.path.exists(filename):
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
112 return parser
2
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
113 parser.read(filename)
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
114 if options.mozilla_central is None:
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
115 try:
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
116 path = parser.get('hg', 'mozilla-central')
3
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
117 if path:
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
118 options.mozilla_central = os.path.expanduser(path)
2
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
119 except Exception: # XXX temporary hack
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
120 pass
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
121 return parser
1
0f8e4a3b4e1c split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
122
3
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
123
1
0f8e4a3b4e1c split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
124
0f8e4a3b4e1c split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
125 def main(args=sys.argv[1:]):
0f8e4a3b4e1c split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
126
0f8e4a3b4e1c split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
127 # parse command line arguments
6
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
128 parser = MozillaTryConfiguration()
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
129 options, args = parser.parse_args()
7
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
130 if not args:
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
131 parser.print_usage()
51d1167cc684 something still wrong here but on the right track, i hope
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
132 parser.exit()
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
133
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
134 # get mozilla-central repository directory
2
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
135 try_directory = options.mozilla_central
3eaee0d10880 make getting mozilla-central slightly less of a hack; soon, we should transition to configuration to make this nice, though lets build the API around it first for now
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
136 if (try_directory is None) or (not os.path.exists(try_directory)):
3
Jeff Hammel <jhammel@mozilla.com>
parents: 2
diff changeset
137 parser.error("mozilla-central directory does not exist: %s" % try_directory)
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
138
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
139 # build try syntax
6
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
140 commit = try_syntax(opt=options.opt,
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
141 debug=options.debug,
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
142 unittests=options.unittests,
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
143 talos=options.talostests
6f35d0d90c64 move more to configuration land
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
144 )
0
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
145 print commit
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
146
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
147 # push to try
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
148 push_to_try(patches=args, repo=try_directory, commit=commit)
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
149
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
150 if __name__ == '__main__':
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
151 main()
df6a8049e9a4 initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
152