Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-01-09 23:43:38 +0400
committerJunio C Hamano <gitster@pobox.com>2013-01-15 21:57:57 +0400
commite6bc8a33286599f99a3a7c38654c85b8d37d6605 (patch)
treecfc9ea2e5ede8ebbc48f5916f1914486bee64241 /contrib
parenteacf0117752780bf418d352a6ad2f033aeda1cce (diff)
remote-hg: store converted URL
Mercurial might convert the URL to something more appropriate, like an absolute path. Lets store that instead of the original URL, which won't work from a different working directory if it's relative. Suggested-by: Max Horn <max@quendi.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Max Horn <max@quendi.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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)