Ref T2230. This is easily the worst thing I've had to write in a while. I'll leave some notes inline.
Details
- Reviewers
asherkin btrahan - Maniphest Tasks
- Restricted Maniphest Task
- Commits
- Restricted Diffusion Commit
rP632466974837: Allow Phabricator to serve Mercurial repositories over HTTP
Ran hg clone http://... on a hosted repo. Ran hg push on the same. Changed sync'd both ways.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
src/applications/diffusion/controller/DiffusionServeController.php | ||
---|---|---|
410–412 | This is used only for "unbundle". | |
426–427 | Magic! | |
433–434 | This discards a length header on commands other than "bundle" and "unbundle". | |
440–456 | Mercurial passes arguments in HTTP headers. :/ | |
458 | This whole thing is completely insane. | |
src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php | ||
6 | We must know the arguments each command takes in order to issue the command. The protocol is actually ten different protocols in one. | |
src/applications/diffusion/response/DiffusionGitResponse.php | ||
33 | This just gets the X-Nosniff-IE-SEcurity header back into the response. |
Wow, that Mercurial...
Can you give me an unbundle example end to end? Sort of like my inline but expanded. Unbundle seems to be a way to push a set of local revs to some server?
src/applications/diffusion/controller/DiffusionServeController.php | ||
---|---|---|
430–431 | so how does this end up presenting to the user? if at all of course. :D |
We can remove that message safely, but we can't echo stdout through or the user gets
remote: 1 remote: 1
...at the bottom instead of lovely duck facts. $body = ""; works fine though and just doesn't echo anything.
src/applications/diffusion/controller/DiffusionServeController.php | ||
---|---|---|
430–431 | $ hg push pushing to http://local.aphront.com:8080/diffusion/HGTEST/ searching for changes http authorization required realm: Phabricator Repositories user: epriestley password: remote: Ducks like to eat bread. >>> orbital ~/devtools/phabricator/HGTEST $ |
I'm down with duck facts.
http://birding.about.com/od/birdprofiles/a/15-Fun-Facts-About-Ducks.htm
A male duck is called a drake....!
My day feels brighter already, thanks to these valuable duck facts.
Sadly I think I am going to remove duck facts -- @asherkin notes that tooling expects other things and possibly commit hooks emit stuff, so we probably need a faithful parser. ;_;
Instead of valuable and interesting duck facts, emit stderr in response to unbundle.
Notably, this shows commit hook output to the user, as well as some other diagnostic/status information.
Some day if we have managed hooks we can restore DUCK FACTS.
Also compress "changegroup" and "changegroupsubset", the old versions of "getbundle".