Mercurial at Savannah
To use Mercurial on Savannah, you first need to enable it for your group; then a cron job will create an empty repository, see VCS Intro.
URL summary
- ssh://hg.sv.gnu.org/group - developer access using SSH
- http://hg.sv.gnu.org/hgweb/group - lightweight http-based protocol (read-only access)
- Web viewer
Basic commands
Checkout with authentication:
hg clone ssh://login@hg.sv.gnu.org/group
For the SSH key fingerprints for hg.sv.gnu.org, check the "Mercurial Repository" link under "Development Tools" on the main page of your group.
Checkout with anonymous read-only access:
hg clone http://hg.sv.gnu.org/hgweb/group
or hg clone https://hg.sv.gnu.org/hgweb/group
Developer setup
Your identity for when you push commits (strongly recommended) editing your user configuration file (\~/.hgrc):
[ui]
username = Your Name Comes Here <you@yourdomain.example.com>
It is also possible to edit per group identity (group/.hg/hgrc).
Developer basic commands
Initial import
If you are creating a new project and wish to upload a fresh repository, proceed as follows to create the repository on your machine:
mkdir test
cd test
hg init
touch README
# edit/add other files...
# Import everything:
hg add .
hg commit -m "Initial import"
Alternatively, if you are importing an existing repository,
just cd
to the repository's top level.
Now fill the repository at Savannah:
hg push ssh://login@hg.sv.gnu.org/group
Note: at this point your repository is not setup to merge _from_ the remote branch when you type 'hg pull'. You can either freshly 'clone' the repository (see "Developer checkout" below), or configure your current repository this way:
Edit group/.hg/hgrc:
[paths]
default = ssh://you@hg.sv.gnu.org/group
Developer checkout
hg clone ssh://login@hg.sv.gnu.org/group
Commit
cd group/
# <edit some_existing_file>
hg commit -m "I automatically commit modified files"
# <edit some_new_file and something_else>
hg add some_new_file
hg commit -m "I only marked some_new_file and other changes for commit"
or
hg commit -A -m "I automatically add new files and commit any other changes"
# <only commit one modified file>
touch some_existing_file
hg commit -m "I only commit one file" some_existing_file
# Check your changes with the graphical tool
hg view
# Check what's going to be pushed
hg outgoing
# Send everything to Savannah
hg push
Importing from other VCS
Mercurial has a convert extension that supports multiple repository types (CVS, Subversion, GNU Arch, Git, darcs...).
You might get an error if the extension is not activated system-wide. In that case, edit your \~/.hgrc:
[extensions]
hgext.convert =
hg convert group
cd group-hg
hg push ssh://login@hg.sv.gnu.org/group
- CVS conversion will also maintain CVS tags.
- GNU Arch conversion does not handle multiple branches or version numbers, thus it only works for a given category--branch--version.