Mercurial 不保存推送的变更集
我最初在 Ubuntu 10.04 机器上设置了 Mercurial。我们有几个项目正在进行,需要可靠的版本控制源。我使用过 Mercurial 并且很喜欢它。我首先安装 Mercurial 并遵循 T 的几个指南。我遵循并取得初步成功的主要指南是 http://phpfour.com/blog/2011/05/setting-up-central-mercurial-server-in-ubuntu/ -- 本指南非常适合我,我不得不编辑一些事情是使用新的 hgwebdir.cgi 而不是 hgweb.cgi,以便我可以在配置下使用集合。
以下是我的相关配置文件:
hgweb.config
[collections]
/var/hg/repos = /srv/hg/repos
hgwebdir.cgi 只是标准文件
我的默认 apache 虚拟主机文件:“/etc/apache2/sites-available/default”
ScriptAlias /hg "/var/hg/hgwebdir.cgi"
<Directory "/var/hg/repos">
AuthType Basic
AuthName "Mercurial Repositories"
AuthUserFile /var/hg/hgusers
Require valid-user
</Directory>
我最初按照我之前所述进行设置上面的教程很到位。第一次就立即起作用了。我一切正常,网站正常运行,推送正常,拉动正常,更新,一切都 100% 完美。
我在服务器上修改了几项内容,并注意到几个小时后存储库已受到其中一项更改的影响。经过近 12 个小时的日志研究后,我决定是时候重新擦拭了。我重新加载了整个盒子,没有任何改变,一切都是默认的。
好吧,请记住,当我说存储库“无法工作”时,这是一种模糊的描述,我将对此进行解释;该网站工作正常,我可以访问 www.mydomain.com/hg 并查看我的存储库,我还可以提交并推送回服务器上的中央存储库,它也在我的 JIRA/Crucible/FishEye 设置中显示了所有这些作为我网站的 www.mydomain.com/hg 目录。很酷,所以你会认为它有效!错误的!我可以推送、进行所有我想要的更改,并在网站上查看它们的更改日志,但是在查看应该更改的文件时;然后我注意到他们根本没有更新。
几个小时后,我想这是因为我做了一些改变;我决定重塑形象重新安装 Mercurial 并进行第二次配置。网站可以正常工作,可以推送、拉取、更新等等。然而,根本没有任何文件被更改!
我将我的存储库文件夹设置为 chown -R www-data "RepoName" ,甚至在默认权限不起作用后对所有内容设置 chmod 777 。很明显,所有者必须是 apache,以便在需要进行更改时可以读/写并执行这些文件。有趣的是,每次我进行更改并将更改集推送到中央 DVCS 时,它实际上都会对 .hg 文件夹进行更改,但不会添加任何未跟踪的文件或对计划在 DVCS 中更改的任何现有文件进行更改。变更集推送到服务器。
我现在真的不知道该朝哪个方向走,我检查了几个指南,甚至尝试以两种不同的方式进行设置,但都无济于事。如果有人对此有任何指导,我会比你知道的更加感激。这似乎是一个主要问题,我想解决它,因为我不能是唯一遇到这个问题的人。我现在只想切换版本控制解决方案,但我猜它曾神奇地工作过一次,但现在它完全坏了。
I initially set up Mercurial on our Ubuntu 10.04 box. We have several projects going on and need a solid source of version control. I have used Mercurial and love it. I first started off by installing Mercurial and following several guides to the T. The main guide I followed and had initial success with was http://phpfour.com/blog/2011/05/setting-up-central-mercurial-server-in-ubuntu/ -- This guide worked perfectly for me, I had to edit a few things up to use the new hgwebdir.cgi instead of hgweb.cgi so that I could use collections under the config.
Here are my configuration files that are relevant:
hgweb.config
[collections]
/var/hg/repos = /srv/hg/repos
hgwebdir.cgi is just the standard file
My default apache virtual host file: "/etc/apache2/sites-available/default"
ScriptAlias /hg "/var/hg/hgwebdir.cgi"
<Directory "/var/hg/repos">
AuthType Basic
AuthName "Mercurial Repositories"
AuthUserFile /var/hg/hgusers
Require valid-user
</Directory>
I initially set this up as I stated earlier following the above tutorial spot on. It worked the very first time instantly. I had everything working, site was going, pushing was working, pulling was working, update, everything, it was 100% flawless.
I got to tinkering around on the server changing several things and noticed hours later the repository had been affected by one of the changes. After nearly 12 hours of looking into logs and such I decided it was time to just fresh wipe. I reloaded the entire box fresh, nothing changed and everything default.
Alright so keep in mind when I say the repository "wasn't working" being how this is kind of a vague description I will explain it; The site worked, I could go to www.mydomain.com/hg and see my repositories, I could also make commits and pushes back to the central repository on the server, it showed all these in my JIRA/Crucible/FishEye setups as well as the www.mydomain.com/hg directory of my site. Cool so you would think it worked! Wrong! I could push, make all the changes that I wanted and see changelogs of them on the site however when looking into the files that were suppose to change; I then noticed they were not updating at all.
Hours later thinking that it was because of some of the changes I made; I decide to reimage. Reinstall Mercurial and configure it over for the second time. Websites working, can push, pull, update, everything. However no files are being changed at all!.
I have my repository folders set to chown -R www-data "RepoName" and even chmod 777 on everything after the default permissions didn't work. Its clear that the owner needs to be apache so that it can read/write and execute these files when changes need to be made. The funny part about this is that everytime I make a change and push the changeset to the central DVCS it will actually make changes to the .hg folder but never add any untracked files or make changes to any existing files that were scheduled to change in the changeset pushed to the server.
I don't really know which direction to go at this point, I have checked several guides and even tried setting things up in two different fashions to no avail. If anyone at all has any guidance on this I would appreciate it more than you know. This seems to be a major problem and I would like to resolve it because I can't be the only person with this issue. I'm to the point to where I just want to switch version control solutions however I had it working once magically I guess and now it is just completely broken.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在服务器上的存储库中运行
hg update
有帮助吗?如果是这样,那么您需要安装
changegroup
挂钩< /a> 在服务器上:关键细节是
hg Push
不会更新接收存储库的工作目录。Does it help if you run
hg update
in the repository on the server?If so, then you need to install a
changegroup
hook on the server:The crucial detail is that
hg push
does not update the working directory of the receiving repository.