Quick Guide to Mercurial SCM

Introduction

As Mercurial is mostly written in Python, you must first install the latest version of Python (2.x or 3?)

Setup

Both the server and the GUI client can be downloaded from http://mercurial.selenic.com/downloads/ . The server part is just a bunch of files: No process is waiting for queries, and the TortoiseHG GUI is just a shortcut to a few binaries.

Once both items are installed, use Windows Explorer to select each projet to create its own repository (not a good idea to create a single repository for all projects), right-click TortoiseHG, and "Create Repository Here".

If you need, edit the .hgignore it created at the root of the project directory, and tell Mercurial what files/directories to ignore:

syntax: glob
bin
obj
temp
*.user
*.suo
*.ncb

To check that Mercurial does use the .hgignore file, right-click on the project directory and choose View File Status with "I : Ignored" checked.

Next, right-click on the project directory, select TortoiseHg, followed by "Add Files...", followed by "Hg Commit".

Since Mercurial uses a local repository, you don't need to check files out of a database: Just edit a file, and hit "Commit".

Q&A

Using TortoiseHG, how to find text in a file or all files in a repository?

In Windows Explorer, right-click on a directory under source control, and choose TortoiseHg > Search History

Resources