aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2015-11-12 15:37:25 -0600
committerAndy Doan <andy.doan@linaro.org>2015-11-12 15:37:25 -0600
commitb7845b6a37cf3459789ceca72d11c20b49abd1d2 (patch)
treef06ddd23dade12e959770128f1837ea784782807
parente9204455301703abf8ce03b0de421e6b63027a94 (diff)
fix grokmirror logic when mirror name and local name differ
I noticed a bug where a mapping like: 96boards/android_device_linaro_hikey = device/linaro/hikey would cause an error in the grokmirror logic because it assume the local repo was named "96boards/android_device_linaro_hikey". This fixes the problem in a few repos. Change-Id: I063f9b0d9cc15f190d6e249ee9df3b03dbd51b4c
-rwxr-xr-xgit-gerrit-mirror8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-gerrit-mirror b/git-gerrit-mirror
index 4b71317..c59207c 100755
--- a/git-gerrit-mirror
+++ b/git-gerrit-mirror
@@ -282,12 +282,14 @@ def update_grok(manifest, repo_root, repo):
run_command(cmd)
-def handle_updated_repos(conf, repos):
+def handle_updated_repos(conf, host, repos):
manifest = conf.get_var(options.dest, 'grok_manifest')
if manifest:
root = conf.get_var(options.dest, 'grok_repo_root')
for p in repos:
- update_grok(manifest, root, p)
+ projname = p[:-len(".git")]
+ mirror_projname = conf.get_mirror_repo(host, projname) + '.git'
+ update_grok(manifest, root, mirror_projname)
def host_url_to_path(host):
@@ -398,7 +400,7 @@ elif args[0] == "push":
log.info("=== Processing: %s (%d repositories) ===",
host, len(git_repos))
push_repos(host, git_repos, force=options.force)
- handle_updated_repos(conf, [x[1] for x in git_repos])
+ handle_updated_repos(conf, host, [x[1] for x in git_repos])
elif args[0] in ("upstream-ls", "ls-upstream"):
check_args(optparser, args, 1)
for host in conf.get_hosts(options.upstream):