Page MenuHomePhorge

Updates for Mercurial's HTTP protocol
ClosedPublic

Authored by speck on Nov 13 2023, 20:58.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 10:48
Unknown Object (File)
Thu, Apr 25, 10:48
Unknown Object (File)
Wed, Apr 24, 22:24
Unknown Object (File)
Wed, Apr 24, 21:17
Unknown Object (File)
Sat, Apr 6, 04:35
Unknown Object (File)
Wed, Apr 3, 09:51
Unknown Object (File)
Sat, Mar 30, 05:52
Unknown Object (File)
Fri, Mar 29, 18:28

Details

Summary

While testing https://secure.phabricator.com/D21864 I ran into some issues getting mercurial HTTP access working. Using wireshark I confirmed that my local mercurial 6.4 was not including command arguments as HTTP headers but in the querystring.

I didn't dig too deep into understanding when/why this started happening. The protocol documents this in wireprotocol.txt.

Command arguments can be sent multiple ways. The simplest is part of the URL query string using `x-www-form-urlencoded encoding (see Python's urllib.urlencode()`. However, many servers impose length limitations on the URL. So this mechanism is typically only used if the server doesn't support other mechanisms.

Based on that either the mercurial on the server is really old (it's 6.1.1 tho) or maybe some other parsing/info passing in Phab's handling of the wire protocol is causing the client to downgrade the wire protocol support.

Cherry-picked from:

https://secure.phabricator.com/D21867

https://secure.phabricator.com/rP0b6e758978a9691bd5ad25db4aa4c4301640a9a9

Test Plan

Host mercurial repo using HTTP, test push/pull.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Restoring original author :) Thanks speck

I completely trust Speck and Evan Priestley that already reviewed this in secure dot. So...

lgtm

This revision is now accepted and ready to land.Nov 13 2023, 21:01
This revision was automatically updated to reflect the committed changes.