changeset 447:daa9356d614f

python/setup_repo.py
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 09 Aug 2013 16:58:12 -0700
parents 95afeaf9c42d
children 056befdec66c
files python/setup_repo.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/python/setup_repo.py	Fri Aug 09 16:28:20 2013 -0700
+++ b/python/setup_repo.py	Fri Aug 09 16:58:12 2013 -0700
@@ -56,7 +56,8 @@
 
     # setup remote repository
     remote_dir = '%s/%s' % (path, name)
-    call(['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)])
+    command = ['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)]
+    call(command)
 
 
 def main(args=sys.argv[1:]):
@@ -75,13 +76,15 @@
                       action='store_true', default=False,
                       help="setup remote server only")
     options, args = parser.parse_args(args)
-    if len(args) != 1:
-        parser.print_usage()
-        parser.exit()
-    directory = args[0]
 
     # initialize repository
-    if not options.remote_only:
+    if options.remote_only:
+        assert options.remote_url
+    else:
+        if len(args) != 1:
+            parser.print_usage()
+            parser.exit()
+        directory = args[0]
         init_repo(directory)
 
     # setup remote, if specified