diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-21 20:15:32 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-21 20:15:32 -0800 |
commit | 9a69ef1e7002040639eada78c30f014c9bfb8481 (patch) | |
tree | f7e38dccc1d7c3d64f53ad4b63a630784914da85 | |
parent | Merge branch 'zk/clean-report-failure' (diff) | |
parent | remote-hg: store converted URL (diff) | |
download | tgif-9a69ef1e7002040639eada78c30f014c9bfb8481.tar.xz |
Merge branch 'fc/remote-hg-fixup-url'
Update to the Hg remote helper (in contrib/).
* fc/remote-hg-fixup-url:
remote-hg: store converted URL
-rwxr-xr-x | contrib/remote-helpers/git-remote-hg | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index c7006000a6..7c74d8bfdc 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -720,6 +720,14 @@ def do_export(parser): if peer: parser.repo.push(peer, force=False) +def fix_path(alias, repo, orig_url): + repo_url = util.url(repo.url()) + url = util.url(orig_url) + if str(url) == str(repo_url): + return + cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % repo_url] + subprocess.call(cmd) + def main(args): global prefix, dirname, branches, bmarks global marks, blob_marks, parsed_refs @@ -766,6 +774,9 @@ def main(args): repo = get_repo(url, alias) prefix = 'refs/hg/%s' % alias + if not is_tmp: + fix_path(alias, peer or repo, url) + if not os.path.exists(dirname): os.makedirs(dirname) |