views:

308

answers:

3

I have a Mecurial repository that I can see just fine if I navigate to it in a browser, but when I try to do a push, with my default path set to the same URL that I visit in the browser, I get this:

abort: HTTP Error 404: Not Found

Should the URL that I push to be different in some way?

+2  A: 

Is this similar to this configuration, where hgweb.config need to be configured properly:

/ = /home/my_username/hg/**

(with the two stars at then end)

Or is it a http vs. https issue?

For https, you need a correct .hgrc file, otherwise you can also get the 404 error.
See the .hg/hgrc file man page.

[ui]

username = [email protected]

password = mypassword

schemes = https

[paths]

default = https://myURL.kilnhg.com/Repo/Repositories/Groups/myrepo
VonC
It wasn't the second, as trying that didn't seem to help. Where should I have a hgweb.config file? I couldn't seem to find where that file should exist in Windows (7).
Mike Pateras
@Mike: the `hgweb.config` would be on the server side: if you don't have access to it, we can only assume it is correct, and that your access credential/schema are somehow faulty.
VonC
I don't know if it was that, specifically, but it was definitely some server side setting.
Mike Pateras
+1  A: 

I had the same problem and it ended up being the VERBs allowed for the CGI handler. I had limited it to GET, POST and HEAD, but ended up changing it to allow all and it works fine now.

Chris Walsh
A: 

I am having a similar problem. I can push/pull some source files, directories, and a .jar file to/from a Mercurial 1.5.4 server running IIS7.5 via HTTPS. (configured roughly as per http://www.jeremyskinner.co.uk/mercurial-on-iis7/).

I successfully committed to my local repository a changeset that added 6 large .exe, .dmg etc installer files (about 130Mb total). However when I attempt to push this changeset to the remote server (remembering I have no problems pushing lots of small source files, txt files, .class files, or a .jar file), my client (MacHG) is reporting the error "Error During Push. Mercurial reported error number 255: abort: HTTP Error 404: Not Found".

I checked on IIS, and the CGI handler is configured to handle ALL verbs (not just GET, POST and HEAD).

My hgweb.cgi file is as follows:

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary

# Path to repo or hgweb config to serve (see 'hg help hgweb')
#config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb('C:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)

My hgweb.config file is as follows:

[collections]
C:\Mercurial Repositories = C:\Mercurial Repositories

[web]
baseurl = /hg
allow_push = usernamea
allow_push = usernameb

Could someone please help?!

coderunner