aboutsummaryrefslogtreecommitdiff
path: root/git-gerrit-mirror
diff options
context:
space:
mode:
Diffstat (limited to 'git-gerrit-mirror')
-rwxr-xr-xgit-gerrit-mirror18
1 files changed, 18 insertions, 0 deletions
diff --git a/git-gerrit-mirror b/git-gerrit-mirror
index 4bc70d0..cfee507 100755
--- a/git-gerrit-mirror
+++ b/git-gerrit-mirror
@@ -367,8 +367,26 @@ options.dest = DEST_KEYWORD + dest
if args[0] == "create":
check_args(optparser, args, 1)
+
+ repo_root = conf.get_var(options.dest, "repo_root")
+ if repo_root:
+
+ for host in conf.get_hosts(options.upstream):
+ log.debug("=== Processing: %s ===", host)
+ projects = get_project_map_for_a_host(host).values()[:options.limit]
+ for p in projects:
+ path = "%s/%s.git" % (repo_root, p)
+ if not os.path.exists(path):
+ if not options.dry_run:
+ os.makedirs(path)
+ 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")
+ sys.exit()
log.debug("Getting list of projects in target Gerrit %s:%s",
gerrit_host, gerrit_port)
existing_projects = get_cached(