I just set up Mercurial on our main webserver, hosting repositories via hgwebdir.cgi. The problem I'm having now is when I run hg push from my local machine to the server's repository, it takes an absolutely ridiculous amount of time to push a very small directory, with only a single changeset. Is it possible that I've set something up wrong? I keep getting HTTP Error 502: Bad Gateway.
1 Answers
Looks a bit like issue 2716 which suggests:
Here's a workaround for the problem you are having, basically instead of doing one huge push, you break it down into many smaller pushes:
Find out the number of revisions of your repository.
Copy and paste the following script, (in bash, use your favorite scripting language if you don't like bash):
#!/bin/bash for rev in {1..NUM_OF_REVS} do hg push -r $rev REPO_URL done
Wait for that to run.
If some of the pushes fail, don't worry, the following push will catch things up.
That being said, issues on Windows IIS has been reported as well.
This "blog post comment" also details:
I got the same error "Bad Gateway" and solved it. Think it's about:
- Install Mercurial 1.2.1 on the server. The version that comes with TortoiseHg is not sufficient, it will not drive the CGI application.
I get a "Bad Gateway" exception when trying to run
hgwebdir.cgi
from a web application which exists on a different drive to my main system drive.If you're using Mercurial 1.5 make sure you are using Python version 2.6.4 to run the cgi scripts in IIS.

- 1,262,500
- 529
- 4,410
- 5,250
-
Thanks, I saw these when I was digging around for a solution, but my repository is very small (maybe 5mb total, 4mb of that being the .hg directory), with only 5 revisions (I'm just testing this so far). I'm using Mercurial 1.5.1 and Python 2.6.5, since those are what the latest version of each are. – tjsimmons Apr 23 '10 at 18:42
-
@tjsimmons: interesting. Then it is a server configuration issue, for which I have no immediate element to add. – VonC Apr 23 '10 at 18:45
-
I'm thinking it's probably a server problem that I have no idea where to go about fixing. I imagine it's a combination of slow down/up speeds here (a single T1 line feeding quite a few workstations), and probably a poor setup on my behalf. – tjsimmons Apr 23 '10 at 18:48
-
@tjsimmons: and Jeff has still yet to respond to your tweet... ;) – VonC Apr 23 '10 at 18:55
-
Haha, I figured since I heard of Mercurial from them, and I'm FAIRLY certain they run all this on IIS, they might have an idea. – tjsimmons Apr 23 '10 at 18:57
-
Also: looking on the server, I first got a message about a failed transaction and to use hg recover, then I'm told the repo has an unknown parent. Could this be the problem? – tjsimmons Apr 23 '10 at 19:03
-
Last wall of text: Removed the repo on the server, cloned it from my machine, push works just fine now. How did this happen? The last thing I need is for the entire website (or at least the repo) to get corrupted. – tjsimmons Apr 23 '10 at 19:09