Search code examples
httpmercurialphabricator

Configuring phabricator to allow push over http


I want to configure Phabricator so I can hg push over http.

For now I configured it as ok, in the repository page appears the command to clone it and in "hosting" configuration I have set it to Read/Write to http (as you can see in the images bellow). Also I have configured the diffusion.allow-http-auth to true and the VCS Password for my user.

Status of the repository: all ok

Hosting - Server over HTTP: Read/Write

I have done a pull from it correctly, and added changes to this local clone.

But when I try to push the initial history/commit, hg show the following error:

% hg push http://*********/diffusion/W/web/
pushing to http://*********/diffusion/W/web/
http authorization required
<--- Credentials Ok -->
realm: Phabricator Repositories
abort: operation not supported over http

What I'm doing wrong? Http can only be used to pull?

Note: I already know that is better to use ssh, but I can't configure the server to use it by other policies that can't be changed. Also, this Question can be related to https://stackoverflow.com/questions/22485732/git-repositories-that-allow-push-pull-over-http


Solution

  • What was affecting me is the version of the mercurial in the server was too old. I have updated it to HG 3.0.1 and now I can push through http.

    And from the task in Phabricator, this what happened with different versions of mercurial:

    • Versions 1.4 to 1.8 will reject the push with abort: operation not supported over http.
    • Versions 1.9 to 2.1 accept the push.
    • Version 2.2 spills this error message when trying to push (and the contents won't be pushed).
    • Versions 2.3 to 3.0 accept the push.

    You can see a related task in Phabricator task T3046.