Thursday, June 4, 2009

Mercurial - using "hg serve" to push changes

I've just discovered Mercurial. It's amazing!!! It's a distributed version control system, similar in its flows to git and others from the bunch so if you're already familiar with the concept you'll have no issues working with it.

One thing however is really amazing: it contains a built-in web user interface! Just while being inside the repository type "hg serve" and browse to http://localhost:8000. And there's more to it. "hg serve" can serve as a real server!

There's one thing worth mentioning. If you'd like to use it for hosting a repository there's one thing you have to add to .hgrc (or Mercurial.ini in case you're working in Windows) to make it work:

[web]
allow_push = *
push_ssl = false

Otherwise while trying to push the changes you'll get a message saying something SSL and stuff.

And like I said - Mercurial is great - go check it out!

4 comments:

Team Guias Rapa Nui said...

Finally I ended up fixing this issue with the same approach.

Still, I think the proper way to get this working is to get be able to push commits through SSL.

Have you sort this out? Also, are you working on PC or Mac?

I´m still getting problems with Murky client on Mac, allthough HortoiseHg works like a charm. But I find plain idiot to run a virtual host everytime I want to push to our central repository.

Michel said...

Wow, thanks for this little "secret" about allowing 'hg serve' to accept pushes. Haven't found it on the Mercurial wiki.

I was just about to install tomcat, till I run into your blog posting..

Thanks, Michel

Tomek Cejner said...

Thanks for the hint - you rank #1 in Google's search when asked for enabling push in hg serve :)

shivram_ss said...

I love posts like these, Common issue, quick no-nonsense solution.