Xplorer2 Lite: TortoiseHg Icon Overlays and Menus Missing

Problem

Xplorer2 Lite is the free version of the Xplorer2 file manager. On your computer, you might find that the TortoiseHg icon overlays and right-click menus are missing in Xplorer2 Lite.

Solution

This problem happens with 64-bit Windows and 64-bit TortoiseHg. 64-bit shell extensions will not work with 32-bit applications. Now, Xplorer2 Lite ships only as a 32-bit executable and thus TortoiseHg (which is a shell extension) icon overlays and menus will not appear with the 32-bit Xplorer2 Lite.

However, the 64-bit TortoiseHg installer does include a 32-bit extension. Download the latest 64-bit TortoiseHg and during installation choose the x86 option (it is unchecked by default) along with the 64-bit extension and both will be installed. Now, both 32-bit programs (like Xplorer2 Lite) and 64-bit programs (like Windows Explorer) will display the TortoiseHg icon overlays and menus.

Tried with: Xplorer2 Lite 1.8.1.4 and TortoiseHg 2.1.2

TortoiseHg from the Command Prompt

TortoiseHg makes Mercurial a joy to use! But, what if you prefer to invoke the TortoiseHg dialogs from the Command Prompt? That is easy too! The command you need to use is thg and you can see all the possible options (dialogs) it supports by using thg --help.

There are 2 dialogs that I frequently use: the Workbench (to look at history) and Commit (to checkin changes). The commands for these are thg log and thg commit respectively.

Tried with: TortoiseHg 2.0.4

Mercurial: Merging Branches

Mercurial users keep insisting that you do not really need to create actual branches to work. But, if you are one of the few who likes to do this, merging branches is just as easy too. I use TortoiseHg, but the equivalent command-line options are just as obvious.

  1. Consider branches A and B. You wish to merge B to A, so that work on A can continue. Typically, A might be the default branch and B can be a feature branch.
  2. Finish, test and commit all the files on both branches A and B.
  3. Open Repository Explorer. Update the working directory to branch A. This can be done by choosing the head of branch A, right-click and choose Update.
  4. Choose the head of branch B, right-click and choose Merge with. Tip of branch A will automatically be chosen as the target for the merge. Click Merge.
  5. Mercurial will try to merge the files automatically as much as possible. For the files with merge conflicts, it will pop up KDiff3 windows so you can pick the changes you want merged. The conflict windows are displayed sequentially, finish one and the next one is displayed.
  6. Settle all the conflicts and your merge is done! Branch B should be connected to branch A nicely in the graph displayed in Repository Explorer now.

TortoiseHg: Add Tag

Adding a tag to a revision in Mercurial is pretty easy at the command-line:

$ hg tag FOOBAR_TAG

However, if you are used to the TortoiseHg workflow, it is not obvious where to find the Add Tag option. To add a tag, open Repository Explorer, click on the revision you wish to tag, right-click and choose the Add/Remove Tag option.

Mercurial/TortoiseHg: Move Files or Directories

A move is called a rename in Mercurial. So, to move a tracked file/directory called Foobar into FooDir use:

$ hg rename Foobar FooDir\Foobar

The UI of TortoiseHg does not seem to be as mature as TortoiseSVN right now (v0.9.3). One cannot move a file/directory by keeping the right mouse button pressed while moving the picked items across to the destination directory. To move a file or directory, right-click and choose TortoiseHgRename File.