aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-04-18 21:44:54 +0300
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-04-18 21:44:54 +0300
commita375dc98fe05b9173e7842311ea8ac2bd0befef1 (patch)
tree097e99a55d37b9e3fadae534c38be6c9ccc951d8
parent330d80926cceaf5dbb028b214a9820bb0eb8c4fe (diff)
downloadlinaro-android-gerrit-support-a375dc98fe05b9173e7842311ea8ac2bd0befef1.tar.gz
git-gerrit-mirror: Create projects locally only for local repo_root.
Fix faulty detection logical of local vs remote Gerrit vs remote something from previous commit. Change-Id: I29807891440754470b50c9e78dc93c9caeed2b0e
-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(