Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. Mercurial is available under the GNU GPL.

Where to download kits

The recommended way to install Mercurial on OpenVMS is to install the Portable Python kit, for more information view Download and installation of Python for OpenVMS

Install Mercurial on OpenVMS

Mercurial is already installed in the Portable Python LD image.

Customize Mercurial on OpenVMS

Mercurial need Python to be installed an started. You, for example, need to create a directorypython_tmp under you login with a version limit set to 1. Must be on a ODS-5 disk.

You can use a different directory on another disk, but you need after the python setup to define the global symbol TMPDIR using a Unix format, example:

$ sh sym tmpdir
  TMPDIR == "/dev/dir/subdir/python_tmp"

Mercurial use a global configuration file /etc/Mercurial/hgrc.

So it a good idea to define a concealed logical ETC, then a directory ETC:[Mercurial] which will be world readable.

Global configuration file ETC:[Mecurial]hgrc. example:



ignore=/etc/Mercurial/hgignore merge = internal:merge3


# evolve extension evolve = amend = topic = rebase = # hg-git extension hgext.bookmarks = hggit =


evolution=all topic-mode = enforce


branch_bookmark_suffix=_bookmark exportbranch=refs/heads/from-hg

# force all patches to always be in git format git=1



Global configuration file ETC:[Mecurial]hignore. example:

syntax: glob

setup a repository

If you want to create your repository in dev:[dir.repository]:

$ @mercurial_root:[vms]setup
$! Create the root Mercurial directory
$ create/directory dev:[dir.repository]/version=1
$ set security/acl=(DEFAULT_PROTECTION,SYSTEM:RWD,OWNER:RWD,GROUP:R,WORLD:R) dev:[dir]repository.DIR
$ set default dev:[dir.repository]
$! Create the Mercurial repository
$ hg init ./
$! Verify the repository
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
0 files, 0 changesets, 0 total revisions
$ directory

Directory dev:[dir.repository]


Total of 1 file.

The “set/security …” ligne is optional, this is to match Unix default protection.

Your Mercurial repository is ready :-)

All files put in the repository must have a record type of STREAM_LF.

Publishing Mercurial Repositories

There are a variety of different ways to publish your Mercurial repositories.

You can start the embedded server using the command “hg serve” or you can use the famous webserver WASD.

First you have to define a configuration repositories configuration file, for example you called it hgweb.config.

Example (partial) configuration file:

$ type hgweb.config


python2x-trunk=/disk$repo/mercurial/repo/python2x-trunk/ python2x-trunk/.hg/patches=/disk$repo/mercurial/repo/python2x-trunk/.hg/patches/ pyrte=repo/pyrte

Publishing Mercurial Repositories using WASD

To serve repositories using WASD, you can:

Create a dedicated user

It is not mandatory to create a dedicated user, but will isolate your server.

The user running the server can be defined like the following example (the name HGSERVER, the UIC [1000,1] are used just as an example):

Username: HGSERVER                         Owner:  Mercurial server
Account:                                   UIC:    [1000,1] ([HGSERVER])
CLI:      DCL                              Tables: DCLTABLES
Default:  DISK5:[HGSERVER]
Flags:  DisCtlY DefCLI LockPwd Restricted DisWelcome DisNewMail DisMail
              DisReport DisReconnect
Primary days:   Mon Tue Wed Thu Fri
Secondary days:                     Sat Sun
Primary   000000000011111111112222  Secondary 000000000011111111112222
Day Hours 012345678901234567890123  Day Hours 012345678901234567890123
Network:  ##### Full access ######            ##### Full access ######
Batch:    -----  No access  ------            -----  No access  ------
Local:    -----  No access  ------            -----  No access  ------
Dialup:   -----  No access  ------            -----  No access  ------
Remote:   -----  No access  ------            -----  No access  ------
Expiration:            (none)    Pwdminimum:  6   Login Fails:     0
Pwdlifetime:         90 00:00    Pwdchange:      (pre-expired)
Last Login: 30-APR-2007 09:43 (interactive), 11-DEC-2009 12:00 (non-interactive)
Maxjobs:         0  Fillm:      1024  Bytlm:      2560000
Maxacctjobs:     0  Shrfillm:      0  Pbytlm:           0
Maxdetach:       0  BIOlm:        10  JTquota:       4096
Prclm:           0  DIOlm:        10  WSdef:         4096
Prio:            4  ASTlm:       100  WSquo:        65536
Queprio:         0  TQElm:       100  WSextent:     65536
CPU:        (none)  Enqlm:     20000  Pgflquo:    2000000
Authorized Privileges:
Default Privileges:
Identifier                         Value           Attributes
Identifiers held by HGSERVER :
  WASD_HTTP_NOBODY                 %X80010027


$ set process/par=extend
$ @python_vms:setup
$ @mercurial_root:[vms]setup
$ exit

:!: The owner of this file can be another user (for example the system account) with an ACL allowing the account HGSERVER to read/execute it.

:!: The repositories served should be owned by the HGSERVER account.

WASD mapping rules

Mapping rule example:

pass /static/* /mercurial_root/mercurial/templates/static/*
pass /repo/static/* /mercurial_root/mercurial/templates/static/*
script+ * /disk$user5/hgserver/hgcgiplus* \
        map=once ods=5 script=syntax=unix script=query=none \
        script=as=hgserver throttle=2,,,30 script=param=PYRTE=/WSGI=BUFFER

You have to add a for every served repository a line “pass /repo/static/* …” where repo is the name of the repository.

This allow the static pages to be served by WASD instead to be served by the mercurial script.

Mercurial for OpenVMS provide a cgiplus script template: MERCURIAL_ROOT:[vms]

You can copy it, then customize you site cgiplus script.

You can also edit WASD configuration filet httpd$auth to allow push only for specific user.

For a single repository:

["Repo repository Authorization"=HGREPO_AUTH=list]
/repo/* read+write; read

For all repositories:

["Repository Authorization"=HG_AUTH=list]
/* read+write; read