从 Eclipse 插件推送到 Mercurial 存储库时收到错误代码:255
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7189319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Receiving Error Code: 255 when pushing to Mercurial repo from Eclipse Plugin
提问by Jivings
I am using HgEclipse from here: http://www.javaforge.com/project/HGE
我从这里使用 HgEclipse:http: //www.javaforge.com/project/HGE
I have created a new repository on my server to test the plugin. I cloned the repository, added some files, committed and attempted to push but received the following error message...
我在我的服务器上创建了一个新的存储库来测试插件。我克隆了存储库,添加了一些文件,提交并尝试推送,但收到以下错误消息...
abort: HTTP Error 500: Internal Server Error. Command line:
/home/james/workspace/project:hg -y push http://***@[repository location],
error code: 255
From some Googling I can find that the 255 error is to do with Authentication, but the password is correct, otherwise I wouldn't be able to clone in the first place.
从一些谷歌搜索我可以发现255错误与身份验证有关,但密码是正确的,否则我将无法首先克隆。
Any help or suggestions would be much appreciated.
任何帮助或建议将不胜感激。
Thanks
谢谢
EDIT: After updating my system to the latest versions I am now also getting this from the command line when pushing (which was previously working):
编辑:将我的系统更新到最新版本后,我现在也可以在推送时从命令行获取此信息(以前可以使用):
abort: HTTP Error 500: Permission denied: .hg/store/data/path-to-file.i
回答by Rudi
Your webserver can't write into the repository. You can either
您的网络服务器无法写入存储库。你可以
- change the permissions in the local repo so that the webserver get write permissions there (which means you need to set up write permissions with chmod for all files and directories under (and including) .hg, also you need to set the sticky-bit to all directories)
- give the webserver an own repo, which is owned by the server.
- 更改本地存储库中的权限,以便网络服务器在那里获得写权限(这意味着您需要使用 chmod 为 .hg 下(包括).hg 下的所有文件和目录设置写权限,还需要将粘性位设置为所有目录)
- 给网络服务器一个自己的仓库,它归服务器所有。
Giving the web serve a repo of its own looks like this:
给 web 服务一个自己的 repo 看起来像这样:
$ sudo bash
# mkdir /srv/repo-base
# chown www-data /srv/repo-base
# cd /srv/repo-base
# su -c "hg clone /path/to/current/repo web-repo-name" www-data
# vi /etc/apache2/sites-available/$SITE_CONFIG_FILE # change the repo path to /srv/repo-base/web-repo-name
# /etc/init.d/apache2 reload
A drawback of this method is that you need to push via http even on the machine with the webserver, since as a normal user you don't have write permissions to the webserver repo.
这种方法的一个缺点是,即使在带有网络服务器的机器上,您也需要通过 http 推送,因为作为普通用户,您没有网络服务器存储库的写入权限。
回答by noelicus
This answered it for me, although it's a different system set-up: TortoiseHg.
In the Repository Settings -> Server
, I set Allow Push
to *
This was on a private network so secured behind a firewall.
这为我解答了这个问题,尽管它是一个不同的系统设置:TortoiseHg。
在 中Repository Settings -> Server
,我设置Allow Push
为*
这是在专用网络上,因此受防火墙保护。