summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Simon Ruderich <simon@ruderich.org>2013-04-11 07:23:13 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-11 10:46:47 -0700
commit2e8e813232d33bb7454cc56edb4b5336b7c89ccd (patch)
tree1634c837c4d8ad4fc5f6f498134d5b3af5af51d8
parentremote-hg: add simple mail test (diff)
downloadtgif-2e8e813232d33bb7454cc56edb4b5336b7c89ccd.tar.xz
remote-hg: add 'insecure' option
If set to true acts as hg's clone/pull --insecure option. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 3ae3598a2b..3eb07dc93c 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -30,6 +30,9 @@ import urllib
# If you don't want to force pushes (and thus risk creating new remote heads):
# git config --global remote-hg.force-push false
#
+# If you want the equivalent of hg's clone/pull--insecure option:
+# git config remote-hg.insecure true
+#
# git:
# Sensible defaults for git.
# hg bookmarks are exported as git branches, hg branches are prefixed
@@ -279,6 +282,12 @@ def get_repo(url, alias):
myui.setconfig('ui', 'interactive', 'off')
myui.fout = sys.stderr
+ try:
+ if get_config('remote-hg.insecure') == 'true\n':
+ myui.setconfig('web', 'cacerts', '')
+ except subprocess.CalledProcessError:
+ pass
+
if hg.islocal(url):
repo = hg.repository(myui, url)
else: