1
votes

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.

1

1 Answers

2
votes

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:

[hooks]
changegroup = hg update

The crucial detail is that hg push does not update the working directory of the receiving repository.