Last updated on November 8, 2017
The process essentially consists of two steps:
Oftentimes Mercurial produces very large HTTP requests (with inordinate number of X-HgArg-...
HTTP headers). This manifests in 400 Bad Request
errors during hg push
operations. To work around this issue, execute the following commands in an Elevated Command Prompt:
reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters /v MaxFieldLength /t reg_dword /d 16384 /f
reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters /v MaxRequestBytes /t reg_dword /d 131072 /f
And then restart HTTP.SYS:
net stop http /y
net start http
net start w3svc
See Microsoft Support Article 820129 for more information.