Skip to content

Commit

Permalink
Merge branch 'fc/remote-hg-fixup-url'
Browse files Browse the repository at this point in the history
Update to the Hg remote helper (in contrib/).

* fc/remote-hg-fixup-url:
  remote-hg: store converted URL
  • Loading branch information
Junio C Hamano committed Jan 22, 2013
2 parents aa0ae51 + e6bc8a3 commit 9a69ef1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 9a69ef1

Please sign in to comment.