summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-01-21 20:15:32 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-21 20:15:32 -0800
commit9a69ef1e7002040639eada78c30f014c9bfb8481 (patch)
treef7e38dccc1d7c3d64f53ad4b63a630784914da85 /contrib
parentMerge branch 'zk/clean-report-failure' (diff)
parentremote-hg: store converted URL (diff)
downloadtgif-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
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg11
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)