comparison mozillatry.py @ 14:06b8783eae81

move another check to validate
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 04 Dec 2012 16:29:53 -0800
parents 1e90d869f787
children 0dfc618488d6
comparison
equal deleted inserted replaced
13:1e90d869f787 14:06b8783eae81
102 configuration.Configuration.validate(self) 102 configuration.Configuration.validate(self)
103 103
104 if (not self.config.get('opt')) and (not self.config.get('debug')): 104 if (not self.config.get('opt')) and (not self.config.get('debug')):
105 raise ConfigurationError("Must have opt or debug builds") 105 raise ConfigurationError("Must have opt or debug builds")
106 106
107 try_directory = self.config.get('mozilla_central')
108 if (try_directory is None) or (not os.path.exists(try_directory)):
109 parser.error("mozilla-central directory does not exist: %s" % try_directory)
110
107 def configuration_files(self, options, args): 111 def configuration_files(self, options, args):
108 configuration_files = configuration.Configuration.configuration_files(self, options, args) 112 configuration_files = configuration.Configuration.configuration_files(self, options, args)
109 if not configuration_files: 113 if not configuration_files:
110 default_config = os.path.expanduser(self.default_config_file) 114 default_config = os.path.expanduser(self.default_config_file)
111 if os.path.exists(default_config): 115 if os.path.exists(default_config):
129 parser.print_usage() 133 parser.print_usage()
130 parser.exit() 134 parser.exit()
131 135
132 # get mozilla-central repository directory 136 # get mozilla-central repository directory
133 try_directory = options.mozilla_central 137 try_directory = options.mozilla_central
134 if (try_directory is None) or (not os.path.exists(try_directory)):
135 parser.error("mozilla-central directory does not exist: %s" % try_directory)
136 138
137 # build try syntax 139 # build try syntax
138 commit = try_syntax(opt=options.opt, 140 commit = try_syntax(opt=options.opt,
139 debug=options.debug, 141 debug=options.debug,
140 unittests=options.unittests, 142 unittests=options.unittests,
141 talos=options.talostests 143 talos=options.talostests
142 ) 144 )
143 print commit 145 print commit
144 146
145 # push to try 147 # push to try
146 push_to_try(patches=args, repo=try_directory, commit=commit) 148 push_to_try(patches=args, repo=options.mozilla_central, commit=commit)
147 149
148 if __name__ == '__main__': 150 if __name__ == '__main__':
149 main() 151 main()
150 152