Mercurial User Repositories

From AlliedModders Wiki
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:

Host hg.alliedmods.net
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 hg.alliedmods.net 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 output of the command should look something like this:

ds@iroh ~ $ ssh hg.alliedmods.net clone myrepo
Making repo myrepo for [email protected].
This repo will appear as hg.alliedmods.net/users/ds_alliedmods.net/myrepo

0) Exit
1) Yes
2) No

Proceed?

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 hg.alliedmods.net 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 http://hg.alliedmods.net/users/mailuser_domain.com. In order to do this, use the edit command:

ds@iroh ~ $ ssh hg.alliedmods.net 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 http://hg.alliedmods.net/users/mailuser_domain.com and you'll be able to browse repository history via a web interface.

Everyone may clone a repository using the following format:

hg clone http://hg.alliedmods.net/users/mailuser_domain.com/myrepo

Pushing Changes

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

ssh://hg.alliedmods.net/users/mailuser_domain.com/myrepo

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://hg.alliedmods.net/users/mailuser_domain.com/myrepo