Follow me on twitter @yodasmydad
Ahhhh #Fringe can't finish like that!! Latest Tweet:

Hey I'm Lee. My blog was put up to house my strange thoughts, ramblings, nuggets of information I can refer back to and document my learning curves on new dev stuff like Umbraco v5 and other .NET related things.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar or terminology, so read at your own risk!

Blogs I Read

Sites I Like

Setting Up Mercurial (Part 1)

This is a very quick and simple guide to get up and running with Mercurial, its actually as much for my own reference as much as anyone else as I am not overly familiar with source control systems (And desperately trying to learn this one thoroughly).

Firstly to get up and running with Mercurial you need to download and install TortoiseHG, this will install both the TortoiseHG and Mercurial locally

http://tortoisehg.bitbucket.org/

Next get the Visual HG visual studio extension so you can get the nice visual aids/menus in VS.

http://visualhg.codeplex.com/

Once you have both of the above installed, you can set up Mercurial for your project.  Go to the very top level folder of your project (The folder that holds your .sln file), and right click on the folder. You should now see in the context menu TortoiseHG > Create Repository Here

image-one

Now Right Click again on the folder and go to Tortoise HG > Global Settings

imagetwo

Leave all settings unless you know what you are doing, the only thing you need to add is your username. Under 'Commit' add your username (i.e. 'Your Name <your@email.com>') then click apply & ok

imagethree

Now open up your project folder, and in the root you should have your ignore file (.hgignore). Open this up in notepad or similar, and then go to

https://gist.github.com/314082

Copy the ignore settings (hgignore.txt section) and paste into the .hgignore and save it and close it (They are shown below for ease of speed).

# Ignore file for Visual Studio 2008
# use glob syntax
syntax: glob
# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Db]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml

Now go back to the root folder, right click and select 'HG Commit' to do the first commit.

imagefour

Check all the files by clicking to top checkbox, and type 'Initial Load' into the textarea (See below) and then click 'Commit' (Then click 'Yes' as you need to add all files before commit)

imagefive

That's it all done for setting up the local repository, now we just need to make Visual Studio know we are using TortoiseHG and we can get the VisualHG icons and context menus.  Open up the project you have just applied the repository too in Visual Studio.

Once open in the top menu's go to Tools > Source Control > Plugin Selection > select 'VisualHG' (See below)

imagesix

That's it, you should now have all the context menus, icons and options available to you to work with the newly created Mercurial Repository.

imageseven

imageeight

I learnt this from watching the Mercural series on TekPub, if you haven't bought a subscription to TekPub then I highly recommend it.  The videos are excellent quality and there is a very broad amount of content, not just Mercurial/.Net based videos.

Back to top