Mercurial User Repositories

From AlliedModders Wiki
Revision as of 04:07, 18 December 2009 by DS (talk | contribs) (A tired rough draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

At AlliedModders, every developer who has commit access to a Mercurial repository (or even an SVN repository that requires SSH access) is able to have their own Mercurial forest. These forests are located under the /users subdirectory and may contain multiple repository clones.

Configuring SSH

So that you won't need to type your username every time, add the following lines to ~/.ssh/config:

User [email protected]

where [email protected] refers to the e-mail address you use for Mercurial or SVN access.

Creating a Repository

In order to create a repository, run the following command. You're going to be using the same command whether you are creating a new, empty repository or cloning an existing one.

ssh clone myrepo

Note: myrepo refers to the name of the new repository you wish to create, not the repository you're trying to clone from.

Runnning the above command will start an interactive script which will prompt you to make a few choices. It is mostly self-explanatory. The out of the command should look something like this:

[email protected] ~ $ ssh clone myrepo
Making repo myrepo for [email protected]
This repo will appear as

0) Exit
1) Yes
2) No


If you select Yes it will proceed to ask you about which existing repository you want to clone from or whether you wish to create a new, empty repository.

Note: As a shortcut, you may add a second argument to the clone command in order to specify an existing repository if you already know which one you wish to clone from:

ssh clone myrepo sourcemod-central

Editing a Repository

Once your repository has been created, you can edit its description. This description will appear when you go to In order to do this, use the edit command:

[email protected] ~ $ ssh edit myrepo
0) Exit
1) Delete the repository
2) Edit the description

What would you like to do?

You may also delete the repository using this command.

Access Via the Web

Your Mercurial forest is visible at and you'll be able to browse repository history via a web interface.

Everyone may clone a repository using the following format:

hg clone

Pushing Changes

In order to push changes, you must use SSH like so:


You may wish to add this to your local repository's hgrc file so that you don't need to type it every time:

default-push = ssh://