Mercurial: Why do I get a 404 error when pushing to a repository whose URL I can hit in a browser?

微笑、不失礼 提交于 2019-12-20 11:36:50

问题


I have a Mercurial 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?


回答1:


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 = my.address@myco.com

password = mypassword

schemes = https

[paths]

default = https://myURL.kilnhg.com/Repo/Repositories/Groups/myrepo



回答2:


We suddenly started getting this error on our main Mercurial repository, hosted under IIS on Windows 2008. When your repository has too many heads, Mercurial POSTs query strings longer than IIS chooses to handle.

You can tell by looking at the sub-status code of the failed request in the IIS logs (it's usually the number after the normal HTTP status code). In this situation, IIS returns a sub-status of 15 which means the query string is too long. Don't forget to check your sub-status codes!

To fix the issue, you'll need to increase IIS's maxiumum query string length:

 # Get the current query string size limit
 c:\windows\system32\inetsrv\appcmd list config /section:requestFiltering -text:requestLimits.maxQueryString

 # Set the new query string size limit
 c:\windows\system32\inetsrv\appcmd set config /section:requestFiltering /requestLimits.maxQueryString:<NEW SIZE>



回答3:


"content too large" is what I had. Go to the IIS logs and look for "404 13".

To fix it, under IIS manager, go the the "Request Filtering" option, and then select the "Headers" tab.

Then go to "Edit Feature Settings" on the right. Then pick a really big number for the "Maximum allowed content (Bytes)" field.

This fixed my issue.




回答4:


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.




回答5:


I received this error while trying to push a lot of changesets, with an especially large-sized one with many binary files (jpg update on a website). [jpg under source control, in the same repo as the source might not be the best approach, but that's besides the point.]

In such a case, if you don't have access to the IIS configuration, a work-around is to push fewer changesets at a time. In TortoiseHg, use the Outgoing feature, right-click the top changeset of the subset you want to push, and select Push To Here. Repeat.



来源:https://stackoverflow.com/questions/2497709/mercurial-why-do-i-get-a-404-error-when-pushing-to-a-repository-whose-url-i-can

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!