User Tools

Site Tools


downloadandinstallationmercurial

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 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.

Also a symbol HGUSER can be used to defined user displayed, for example: HGUSER == “FirstName LastName <emailAdress>”

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

[trusted]
users=*
groups=*

[hostfingerprints]
hg.code.sf.net = ba:9c:a6:31:d6:a1:46:1f:49:d2:d4:1c:0a:96:9a:c1:74:f7:e2:36
hg.python.org = f4:21:58:34:4e:26:dd:55:16:51:2e:ce:6e:58:a8:92:6e:32:c8:50

[ui]
ignore=/etc/Mercurial/hgignore
ssh = ssh -q -o "batchmode yes"

[web]
allow_push=*
push_ssl=false

[extensions]
hgext.mq =
extdiff =

#alias =

[diff]
# prevent qrefresh from updating timestamps
nodates=1
# force all patches to always be in git format
git=1

[extdiff]
cmd.interdiff = hg-interdiff

[debug]
dirstate.delaywrite=1

[alias]
# show files affected by all applied patches
qpstatus = status --rev qparent
qstatus = status --rev qparent:qtip
# show diff for all applied patches
qpdiff = diff --rev qparent
# show revision history since qparent (last pulled revision)
qlog = log -r qtip:qparent

[hooks]
# Prevent "hg pull" if MQ patches are applied.
prechangegroup.mq-no-pull = @mercurial_root:[vms]not_status_cmd "hg qtop"
# Prevent "hg push" if MQ patches are applied.
preoutgoing.mq-no-push = @mercurial_root:[vms]not_status_cmd "hg qtop"
# pretxncommit.fail = PIPE hg heads -v ; EXIT 2

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

syntax: glob
*.dia
*.DIA
*.obj
*.OBJ
*.olb
*.OLB
*.exe
*.EXE
*.lis
*.LIS
*.log
*.LOG
*.map
*.MAP
*.tmp
*.TMP
tmp*
TMP*
*.tpu$*
*.TPU$*
*.dll
*.idb
*.pdb
*.pch
*.ncb
*.res
*.sbr
*.class
*.%ar
*.zip
*.ZIP
*.RDB
*.SNP
*.RDA
*.ps
*.pdf
*.tex
*.dvi*

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]

^.hg.DIR;1

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
[paths]
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]
LGICMD:   SYS$MANAGER:LOGIN_HGSRV.COM
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:
  NETMBX       TMPMBX
Default Privileges:
  NETMBX       TMPMBX
Identifier                         Value           Attributes
Identifiers held by HGSERVER :
  WASD_HTTP_NOBODY                 %X80010027

The file SYS$MANAGER:LOGIN_HGSRV.COM contains:

$ 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]hgcgiplus.com

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

Demonstration

downloadandinstallationmercurial.txt · Last modified: 2014/11/13 10:44 by jfp