Alex Rivera | Logout

DVCS with a Windows central repository

Asked 2009-04-28T18:09:15.700
24

We are currently using VSS for version control. Quite few of our developers are interested in a distributed model (And want to get rid of VSS). Our network is full of Windows machines and while our IT department has experience maintaining Linux machines they would prefer not to.

What DVCS systems can host their central repository on Windows while providing..

  1. Push access to the repository.
  2. Basic authentication. Mostly just a way to allow or deny access to the whole repository. No need for fine grained access.
  3. Server process so users don't need write right to the repository reducing the risk of accidentally messing with it.

On the client side a GUI such as Tortoise would be more or less a requirement (Sorry, Windows shell sucks. :|). Ease of installation would be a huge plus as our IT department is already quite low on resources. And using windows credentials for authentication would be an advantage but not a requirement as long as the client is able to store the credentials.

I have had a (really) quick look at Git, Mercurial and Bazaar.

  • Git seemed to use ssh or simple WebDAV for repository access, requiring write permission for the users.
  • Mercurial had a built in http server, but this seemed to be only for pull purposes. Update: Mercurial supports push as well.
  • Bazaar Seemed to use sftp for repository access, again requiring a write permission for the users.

Are there windows server processes for any DVCS systems and has anyone managed to set one up in a Windows land?

And apologies if this is a duplicate question. I couldn't find one.

Update

Got Mercurial working for push purposes! Detailed list what was required can be found as an answer below.

Edit
Report

3 Answers

17

Mercurial's almost certainly your easiest option on Windows.

If you didn't care about authentication, you actually can trivially allow hg serve to permit push. To do so, you merely need to add the following to the .hg/hgrc file in the repository you wish to serve:

[web]
allow_push = *
push_ssl = false

The first line says that anyone may push to this repository. The second tells Mercurial to allow pushing without SSL, since hg serve does not currently natively support HTTPS. At this point, users can push to your repository without having an account anywhere. If you're simply a small shop, that's probably fine--especially since you can use Mercurial's ability to sign changesets to guarantee a much higher level of verifiability than HTTP Basic will provide, anyway.

For a larger, shop, though, you'd be totally right in wanting at least a simple barrier for committing. To do that, you need to make two changes. First, you'll need to put Mercurial behind a web server with either reverse proxy support or CGI support. Thankfully, recent versions of IIS support both. You can consult the CGI directions in the Mercurial Redbook for Mercurial-specific steps, and Microsoft's guide to setting up CGI applications in IIS 6 for help on the IIS side.

Next, you'll need to set up some basic authentication. IIS provides HTTP Basic out-of-the-box, which, as a bonus, can authenticate directly against your domain, keeping administrative overhead to a minimum.

Finally, you'll want to change the allow_push line to support only specific users by specifying a comma-delimited list of

answered 2009-04-28T19:10:52.167
12

After Benjamin pointed out the HTTP serving CGI scripts I decided to try those out and managed to get a repository hosted over HTTP. The Redbook which Benjamin linked was of much help as were two Mercurial wiki articles. One which describes Mercurial publishing in general and another containing step by step instructions for setting up the HgWebDir CGI script.

These instructions weren't completely foolproof though so I had to poke around a bit. Most likely as I'm running 64bit Vista. The instructions below document what I did. Now that I've done it once I'd probably do things in another order so don't consider these step by step instructions.

Mercurial

First I acquired the Mercurial binary from http://mercurial.berkwood.com/ which got installed into d:\dev\Mercurial. I created a repository for testing under d:\dev\testRepo repository using hg init. The d:\dev\Mercurial\library.zip contains Mercurial library files required by the CGI script so they were extracted to d:\dev\Mercurial\library. Something which confused me at first is that when I opened the zip file I received an error message and saw no contents. Just extracting the file to a directory worked though.

For the web script, I downloaded Mercurial source which contained the hgwebdir.cgi which got moved and renamed to d:\dev\Mercurial\webroot\hgwebdir.py

answered 2009-04-28T22:12:41.183
0

SCM-agnostic (to some degree) Windows-solution with Repository-frontent and management today may be SCM-Manager (Git, Mercurial, SVN repo out of a box with a single requirement of JVM)

answered 2012-12-06T13:58:28.030

Your Answer