aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-gerrit-mirror10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-gerrit-mirror b/git-gerrit-mirror
index 7c17c41..0cfd974 100755
--- a/git-gerrit-mirror
+++ b/git-gerrit-mirror
@@ -381,9 +381,12 @@ options.dest = DEST_KEYWORD + dest
if args[0] == "create":
check_args(optparser, args, 1)
+ gerrit_host = conf.get_var(options.dest, "gerrit_host")
+ gerrit_port = conf.get_var(options.dest, "gerrit_port")
repo_root = conf.get_var(options.dest, "repo_root")
- if repo_root:
+ if not gerrit_host and repo_root[0] == "/":
+ # Create repository locally
for host in conf.get_hosts(options.upstream):
log.debug("=== Processing: %s ===", host)
projects = get_project_map_for_a_host(host).values()[:options.limit]
@@ -395,11 +398,10 @@ if args[0] == "create":
run_command("GIT_DIR=%s git init --bare" % path)
sys.exit()
- gerrit_host = conf.get_var(options.dest, "gerrit_host")
- gerrit_port = conf.get_var(options.dest, "gerrit_port")
if not gerrit_host:
- log.warn("No Gerrit host defined for this destination, so nowhere to create projects")
+ log.warn("Non-local repo_root: Don't know how to create projects")
sys.exit()
+
log.debug("Getting list of projects in target Gerrit %s:%s",
gerrit_host, gerrit_port)
existing_projects = get_cached(