Skip to content

Commit 2e8e813

Browse files
rudisgitster
authored andcommitted
remote-hg: add 'insecure' option
If set to true acts as hg's clone/pull --insecure option. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b3ab6fd commit 2e8e813

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/remote-helpers/git-remote-hg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ import urllib
3030
# If you don't want to force pushes (and thus risk creating new remote heads):
3131
# git config --global remote-hg.force-push false
3232
#
33+
# If you want the equivalent of hg's clone/pull--insecure option:
34+
# git config remote-hg.insecure true
35+
#
3336
# git:
3437
# Sensible defaults for git.
3538
# hg bookmarks are exported as git branches, hg branches are prefixed
@@ -279,6 +282,12 @@ def get_repo(url, alias):
279282
myui.setconfig('ui', 'interactive', 'off')
280283
myui.fout = sys.stderr
281284

285+
try:
286+
if get_config('remote-hg.insecure') == 'true\n':
287+
myui.setconfig('web', 'cacerts', '')
288+
except subprocess.CalledProcessError:
289+
pass
290+
282291
if hg.islocal(url):
283292
repo = hg.repository(myui, url)
284293
else:

0 commit comments

Comments
 (0)