Skip to content

Commit 9a69ef1

Browse files
committed
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
2 parents aa0ae51 + e6bc8a3 commit 9a69ef1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/remote-helpers/git-remote-hg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,14 @@ def do_export(parser):
720720
if peer:
721721
parser.repo.push(peer, force=False)
722722

723+
def fix_path(alias, repo, orig_url):
724+
repo_url = util.url(repo.url())
725+
url = util.url(orig_url)
726+
if str(url) == str(repo_url):
727+
return
728+
cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % repo_url]
729+
subprocess.call(cmd)
730+
723731
def main(args):
724732
global prefix, dirname, branches, bmarks
725733
global marks, blob_marks, parsed_refs
@@ -766,6 +774,9 @@ def main(args):
766774
repo = get_repo(url, alias)
767775
prefix = 'refs/hg/%s' % alias
768776

777+
if not is_tmp:
778+
fix_path(alias, peer or repo, url)
779+
769780
if not os.path.exists(dirname):
770781
os.makedirs(dirname)
771782

0 commit comments

Comments
 (0)