debugcommands: support sending HTTP requests with debugwireproto
We implement an action that can issue an HTTP request. We can define
headers via arguments and specify a file to use for the HTTP request
body.
The request uses the HTTP peer's opener, which is already configured
for auth, etc. This is both good and bad. Good in that we get some
nice behavior out of the box. Bad in that some HTTP request headers
are added automatically.
Differential Revision: https://phab.mercurial-scm.org/D2841
# extension to emulate interrupting filemerge._filemerge
from __future__ import absolute_import
from mercurial import (
error,
extensions,
filemerge,
)
def failfilemerge(filemergefn,
premerge, repo, wctx, mynode, orig, fcd, fco, fca,
labels=None):
raise error.Abort("^C")
return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)
def extsetup(ui):
extensions.wrapfunction(filemerge, '_filemerge',
failfilemerge)