Windows – Will mercurial work properly with multiple users using a single working copy on a share

mercurialwindows

I'm looking for a solution where I can install version control in a corporate environment in the least intrusive way possible. One possible solution I was considering was getting mercurial set up on each of the windows desktops and just setting up working copies of repos on the share. So there would be no server installation of mercurial. Obviously this doesn't solve multiple users on the same file at the same time but that's not a problem we are trying to solve. And this isn't backup, but then again version control isn't supposed to be backup. Plus we have plenty of backup.

Would this setup just work? Will usernames in the commit logs be recorded properly. Or would everything appear to be committed by the same user? Anyone have any experience with this setup?

Best Answer

Yes, you can do what you suggest. Modern versions of Mercurial don't really care where the working copies are stored — they can be stored on a local disk or a network filesystem.

We've had some problems in the past (before version 1.7.1) where Mercurial would fail to break hardlinks in repositories stored on network filesystems. The problem is that two repositories will be hardlinked on the server if you do hg clone foo bar. If a user push a commit to bar, and accesses the repository over the network share, then it's critical that Mercurial discoveres that the files inside bar/.hg/store are hardlinked to foo/.hg/store so that it can break the links. Due to various kernel bugs in Windows and Linux, this could fail with old versions of Mercurial.

So, to recap: your server does not need Mercurial installed if you just install Mercurial on all the clients. Create (I hope I remember the UNC paths correctly)

\\server\share\main

as the main repository and make clones for the developers:

\\server\share\alice
\\server\share\bob

Alice and Bob will work there and modify the working copies independently. They make commits as normal and when they're ready, they push back to the main repo. The usernames are stored in the changesets, so they will be retained when the changesets go into the main repo.

Related Topic