comparison mercurial/debugcommands.py @ 37553:6b08cf6b900f

httppeer: allow opener to be passed to makepeer() This allows us to use makepeer() in `hg debugwireproto`. Differential Revision: https://phab.mercurial-scm.org/D3238
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 10 Apr 2018 13:07:13 -0700
parents 8b8a845c85fc
children 734515aca84d
comparison
equal deleted inserted replaced
37552:8b8a845c85fc 37553:6b08cf6b900f
2913 peer = None 2913 peer = None
2914 elif opts['peer']: 2914 elif opts['peer']:
2915 raise error.Abort(_('--peer %s not supported with HTTP peers') % 2915 raise error.Abort(_('--peer %s not supported with HTTP peers') %
2916 opts['peer']) 2916 opts['peer'])
2917 else: 2917 else:
2918 url, caps = httppeer.performhandshake(ui, url, opener, 2918 peer = httppeer.makepeer(ui, path, opener=opener)
2919 httppeer.urlreq.request)
2920
2921 peer = httppeer.httppeer(ui, path, url, opener,
2922 httppeer.urlreq.request,
2923 caps)
2924 2919
2925 # We /could/ populate stdin/stdout with sock.makefile()... 2920 # We /could/ populate stdin/stdout with sock.makefile()...
2926 else: 2921 else:
2927 raise error.Abort(_('unsupported connection configuration')) 2922 raise error.Abort(_('unsupported connection configuration'))
2928 2923