changeset 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
files mozillatry.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mozillatry.py	Tue Dec 04 16:25:31 2012 -0800
+++ b/mozillatry.py	Tue Dec 04 16:29:53 2012 -0800
@@ -104,6 +104,10 @@
         if (not self.config.get('opt')) and (not self.config.get('debug')):
             raise ConfigurationError("Must have opt or debug builds")
 
+        try_directory = self.config.get('mozilla_central')
+        if (try_directory is None) or (not os.path.exists(try_directory)):
+            parser.error("mozilla-central directory does not exist: %s" % try_directory)
+
     def configuration_files(self, options, args):
         configuration_files = configuration.Configuration.configuration_files(self, options, args)
         if not configuration_files:
@@ -131,8 +135,6 @@
 
     # get mozilla-central repository directory
     try_directory = options.mozilla_central
-    if (try_directory is None) or (not os.path.exists(try_directory)):
-        parser.error("mozilla-central directory does not exist: %s" % try_directory)
 
     # build try syntax
     commit = try_syntax(opt=options.opt,
@@ -143,7 +145,7 @@
     print commit
 
     # push to try
-    push_to_try(patches=args, repo=try_directory, commit=commit)
+    push_to_try(patches=args, repo=options.mozilla_central, commit=commit)
 
 if __name__ == '__main__':
     main()