Web developer from Sydney Australia. Currently using asp.net, mvc where possible.

Tuesday, May 18, 2010

Set Default Outgoing Repository with hg (Mercurial)

Firstly if you are new to Mercurial check out http://hginit.com/ its a brilliant little Mercurial tutorial.

When creating a hg repository locally, at some point later, I often need to set the default outgoing repository to push out my changes.

Creating projects locally using hg (hg init) without cloning from anther location is ideal for playing with new projects locally and having your source code version controlled.

There are so many times where I spend about 10 minutes going down a path then find out that I don't want to continue. With mercurial or git as a local version control system, you can simply revert back your changes to the last commit.

When the time comes to publish your changes to the world, setting up a default outgoing repository in hg saves a lot of typing.

Here is how to do it
  1. Go to the .hg folder in the root of your repository
  2. Create a new file called "hgrc"
  3. Enter your default outgoing repository as show below.

That's it. Now you can just enter "hg outgoing" to see the list of change-sets that need to be pushed to your default repository and "hg push" to actually push out your changes.

Codeplex now has Mercurial as an option for version control.

Here is a copy paste sample for the Jobping Url Shortener project on codeplex
default = https://hg01.codeplex.com/jpurlshortener

kick it on DotNetKicks.com


Unknown said...

I have known many information from this.


Mechanical Seals

Blogger said...

Did you know you can shorten your long links with AdFly and make dollars from every click on your shortened urls.