Chapter 1. Using Mercurial with Smalltalk/X

Table of Contents

1. Step-by-Step Example
1.1. Setting up a Mercurial Repository
1.2. Setting up Smalltalk/X to use Mercurial Repository
1.3. Commiting Changes
2. Setting Up Mercurial
3. Troubleshooting
3.1. Bug reporting

This chapter describes how to use Mercurial with Smalltalk/X. By its nature, this document is, and always be incomplete a not up-to-date. Please report inconsistencies to the autor, preferably using bug tracker (see Section 3.1, “Bug reporting” for details).

1. Step-by-Step Example


Short tutorial describes how to use Mercurial within Smalltalk/X environment for the impatient.

Thorough this tutorial, we will use a fictious package jv:hg_tutorial.

1.1. Setting up a Mercurial Repository

Create or clone your repository in your so-called package path as usual. Like in Java, package sources must be located in directory whose name matches a package name. For package named jv:hg_tutorial the directory would be jv/hg_tutorial, for paclkage stx:goodies/sunit it would be stx/goodies/sunit. To check content of your package path, inspect:

Smalltalk packagePath

You may add your own directories to a Smalltalk/X package path by evaluating

Smalltalk packagePath add: 'C:\path\to\your\packages'.

To make it permanent, add the above snippet to your user startup script (%USERPROFILE%\.smalltalk\p_%USERNAME%.rc on Windows, ${HOME}/.smalltalk/p_${USER}.rc on UNIX.).

So, let's create an empty mercurial repository in C:\Users\jv\.smalltalk\packages (a default location for user packages):

cd \Users\jv\.smalltalk\packages
mkdir jv
hg init jv\hg_tutorial

If there is already a repository, just clone it like:

cd \Users\jv\.smalltalk\packages
mkdir jv
hg clone jv\hg_tutorial

1.2. Setting up Smalltalk/X to use Mercurial Repository

Second step is to configure your Smalltalk/X IDE to use Mercurial for your packages. Open settings (in Launcher select SystemSettings, go to Source Code Management and press Add... to add a new package mapping. Enter a package name (jv:hg_tutorial) and select Mercurial+ as source code manager. Don't forget to apply and save your settings.


Make sure you have selected Mercurial+ and not Mercurial (without plus and the end), Mercurial without plus refer to and older attempt to build a Mercurial integration which was never finished and probably will vanish soon.

Figure 1.1. Configuring Smalltalk/X to use Mercurial for given package

Configuring Smalltalk/X to use Mercurial for given package

A source code manager for given package is searched by matching package if match patter against the actual package name from top to bottom. First matching is used. You may want to test your setting; to do so, just press Test button to open test tool.


Do not forget to tick Show in Menus checkbox in Mercurial-specific settings, otherwise menu items for working with Mercurial won't be shown. Refer to for Section 2, “Setting Up Mercurial”details.

Figure 1.2. A test tool to check your source code management settings

A test tool to check your source code management settings

1.3. Commiting Changes

Figure 1.3. Commiting Modified Package to a Mercurial Repository

Commiting Modified Package to a Mercurial Repository