Skip to content

Commit

Permalink
remote-hg: add 'insecure' option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Ruderich authored and Junio C Hamano committed Apr 11, 2013
1 parent b3ab6fd commit 2e8e813
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2e8e813

Please sign in to comment.