3

Right now I have my repo on my local drive. In order to back it up, I have to copy .hg to a window's network drive.

At Is it a good idea to put Mercurial Repository in shared Network drive?, Lasse Karlsen said the repo shouldn't be on a shared folder on a network server because "mercurial cannot reliably hold locks in all situations".

Would this still be an issue when the repository is only updated by a single user?

If so, can someone explain to me why the corruption happens?

A while back our IT had problem setting up a mercurial server.

I am very fond of mercurial (it has a great interface and is very easy to work with), but if it's going to be such a pain in the neck to set up for multiple users, I am willing to look for something else. Does anyone have any suggestions (with reasons)?

I am looking for a revision control program that has the following attributes: 2. Good interface (allow you to easily see revision and changes to the code over multiple revisions). 3. Work as a local repo or a network repo. 4. IT will feel comfortable installing on their network.

Thanks, Stephen

Community
  • 1
  • 1
user1164199
  • 359
  • 4
  • 12
  • Why shared-drive, not simple and easy `hg serve` + `hg pull`? – Lazy Badger Jun 12 '14 at 02:08
  • Do mean put hg serve on the server or on my local computer? IT had problems setting up mercurial on their server. My local drive is not backed up. – user1164199 Jun 12 '14 at 14:19
  • What is http-repo and how can I help/convince IT to set up hg serve on their server? – user1164199 Jun 12 '14 at 14:24
  • Actually, I probably need to use ssh-host since I want to make sure the person who changed/updated the repo is actually the person that changed/updated the repo. Can someone give me a simplified description of setting up ssh-host that would be easily understandable by IT? – user1164199 Jun 12 '14 at 14:49
  • Ok, Rhodecode looks like a good way to go. Has anyone had any issues with it? – user1164199 Jun 12 '14 at 17:47
  • I am a little concerned with Rhodecode since their's no support offered for the free version. Does anyone have any pricing information on the support version? I noticed theirs a lot of extra software described in the install and setup (http://rhodecode.readthedocs.org/en/latest/setup.html). Has anyone had any experience installing and setting it up? – user1164199 Jun 12 '14 at 21:06
  • Instead of Rhodecode (too fat) for backup purposes you can start from reading http://mercurial.selenic.com/wiki/PublishingRepositories http://mercurial.selenic.com/wiki/MultipleCommitters http://mercurial.selenic.com/wiki/SharedSSH and|or use 3-rd party Mercurial Hosting (private repo on Bitbucket?) – Lazy Badger Jun 12 '14 at 21:41
  • We want to keep the mercurial databases located on our company's server. I have decided to try out HgLab. I will try to keep you up to date on my progress. Thanks for all the information. – user1164199 Jun 16 '14 at 17:38

3 Answers3

5

I suppose, in solo-mode (only one user|one proccess, initiated by used modify repository) repository on network drive will not lost locks and will be not broken.

But any DVCS by design offer more natural and reliable way of having backup: creating clones of original repository and syncing with upstream (hg serve + http-repo is easy way, ssh-host and ssh-type remote repo is only slightly harder way)

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
4

Here is a Mercurial list thread about "repository on Samba Share" where Matt Mackall (Mercurial developer) says "lots and lots of people do just fine with Mercurial on networked filesystems".

That hasn't been my personal experience though. At home (single user scenario), I was running Mercurial repo over SMB on a very cheap no-name brand NAS server (implying a low quality protocol implementation) and it would reliably corrupt the repo.

I also ran a personal repo at work on a more serious enterprise NAS setup (implying a higher quality protocol implementation) and it seemed to work fine for the short time I used it (moved the repo off to a proper setup pretty quickly after the problems at home).

So I guess it depends on your confidence in the quality of the network file system provided by your IT ("problems setting up a Mercurial server" would not inspire confidence in me personally).

Shorn
  • 19,077
  • 15
  • 90
  • 168
  • You said "it seemed to work Ok for a while". Did it not work well after a certain period of time? Also, the shared network drive is a window's shared network drive. – user1164199 Jun 12 '14 at 14:28
  • It worked fine. Didn't corrupt the mercurial repository, as opposed to what happened at home. – Shorn Jun 13 '14 at 03:21
1

We manged our central Mercurial repositories for a small team on shared network drives (Windows environment) without any problems.
Mercurial managed the locks well and all the developers were happy.

On top of this, we also had a backup of the repositories from the shared drive to a backup system.

This setup worked well for over a year and was eventually replaced by putting the central repositories on a dedicated server that exposed them using hg serve. This was done to allow easier access for remote users, and also improved performance.

EDIT: An example on redirecting from httpd to hg serve. The Mercurial hg serve is running with the following command:

hg serve --address 2.2.2.2 --port 8081 --prefix mercurial --accesslog /opt/mercurial/access.log --errorlog /opt/mercurial/error.log --webdir-conf /opt/mercurial/hgweb.config --pid-file /opt/mercurial/hg.pid --encoding utf8

In the httpd.conf

# Mercurial web server
ProxyPass         /mercurial  http://2.2.2.2:8081/mercurial
ProxyPassReverse  /mercurial  http://2.2.2.2:8081/mercurial
<Proxy http://2.2.2.2:8081/mercurial*>
  Order deny,allow
  Allow from all
</Proxy>

Any call to http://<my httpd host>/mercurial will be redirected to http://2.2.2.2:8081/mercurial

I hope this helps.

Eldad Assis
  • 10,464
  • 11
  • 52
  • 78
  • With hg serve, how can you be certain the person that changed the repo is actually the person that changed the repo? – user1164199 Jun 12 '14 at 14:32
  • @user1164199 - you can't, except using some type of verification. [Commitsigs Extension](http://mercurial.selenic.com/wiki/CommitsigsExtension) is good attempt – Lazy Badger Jun 12 '14 at 17:16
  • You can also put `hg serve` behind an Apache web server that has authentication setup, where you can track access to repositories. – Eldad Assis Jun 12 '14 at 18:02
  • Ok. I played around with Apache web server over 1.5 years ago, however, I only hosted files on the server. How do you setup hg serve on Apache or maybe you can point me in the right direction. – user1164199 Jun 12 '14 at 21:02
  • Our httpd setup is within our LAN so there is no authentication added to it. If you are in the LAN, you are allowed access to all our repositories. Sorry - can't help you, but you should be able to find tons of examples of setting up httpd with active directory or other authentication methods. I'll add an edit to my post with an example of forwarding httpd to the `hg serve` process. – Eldad Assis Jun 13 '14 at 04:54