# HG changeset patch # User Jeff Hammel # Date 1376092692 25200 # Node ID daa9356d614f765143b9fcbb639ce2fe622ea590 # Parent 95afeaf9c42de68730e930bbc8c05fad24cbc14b python/setup_repo.py diff -r 95afeaf9c42d -r daa9356d614f python/setup_repo.py --- 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