Mercurial > mozilla > hg > MozillaTry
annotate mozillatry.py @ 5:416f4562005c
more switching to configuration parser
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 04 Dec 2012 11:09:45 -0800 |
parents | 14275dcbff10 |
children | 6f35d0d90c64 |
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: |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
66 message += ['--post-to-bugzilla', str(bug)] |
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 |
4
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
69 class MozillaTryConfiguration(configuration.Configuration): |
5
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
70 |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
71 usage = '%prog [options] patch <patch2> <...>' |
4
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
72 options = {'opt': {'default': True, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
73 'help': "whether to try on opt builds"}, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
74 'debug': {'default': True, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
75 'help': "whether to try on debug builds"}, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
76 'unittests': {'default': [], |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
77 'help': "unit tests to run", |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
78 'flags': ['-u', '--unittests']}, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
79 'talostests': {'default': [], |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
80 'help': "talos tests to run", |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
81 'flags': ['-t', '--talostests']}, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
82 'mozilla_central': {'help': "path to mozilla-central clone", |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
83 'required': True, |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
84 'flags': ["--m-c", "--mozilla-central"]} |
14275dcbff10
begin switching to configuration package
Jeff Hammel <jhammel@mozilla.com>
parents:
3
diff
changeset
|
85 } |
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
|
86 |
5
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
87 def __init__(self): |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
88 configuration.Configuration.__init__(usage=self.usage, load='--config') |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
89 |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
90 def check(self, parser, options, args): |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
91 """check configuration""" |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
92 |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
93 if not args: |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
94 parser.print_help() |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
95 parser.exit() |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
96 if (not options.opt) and (not options.debug): |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
97 parser.error("Must enable opt or debug builds") |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
98 |
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
99 |
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
|
100 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
|
101 """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
|
102 |
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
|
103 # 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
|
104 # 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
|
105 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
|
106 parser = ConfigParser() |
3 | 107 if not os.path.exists(filename): |
108 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
|
109 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
|
110 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
|
111 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
|
112 path = parser.get('hg', 'mozilla-central') |
3 | 113 if path: |
114 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
|
115 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
|
116 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
|
117 return parser |
1
0f8e4a3b4e1c
split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents:
0
diff
changeset
|
118 |
3 | 119 |
1
0f8e4a3b4e1c
split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents:
0
diff
changeset
|
120 |
0f8e4a3b4e1c
split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents:
0
diff
changeset
|
121 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
|
122 |
0f8e4a3b4e1c
split add_options to its own method for consumption
Jeff Hammel <jhammel@mozilla.com>
parents:
0
diff
changeset
|
123 # parse command line arguments |
5
416f4562005c
more switching to configuration parser
Jeff Hammel <jhammel@mozilla.com>
parents:
4
diff
changeset
|
124 config = MozillaTryConfiguration() |
0
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
125 |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
126 # 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
|
127 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
|
128 if (try_directory is None) or (not os.path.exists(try_directory)): |
3 | 129 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
|
130 |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
131 # build try syntax |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
132 commit = try_syntax(**options.__dict__) |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
133 print commit |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
134 |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
135 # push to try |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
136 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
|
137 |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
138 if __name__ == '__main__': |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
139 main() |
df6a8049e9a4
initial port from http://k0s.org/mozilla/try.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
140 |