Installing Mercurial is relatively straightforward...
Some repositories make use of the HgExternals plugin, which should be installed prior to use. (Installation on Unix-based systems may be done using setup.py in the distribution).
If you wish to start work on an existing repository (such as one of the ones at http://dig.csail.mit.edu/hg/), simply call hg clone URL
, where URL is the URL of the particular repository (e.g. http://dig.csail.mit.edu/hg/aintno). This will automatically create a new directory named after the last element in the path (e.g. aintno) and check out the most recent revision of the remote repository into that directory.
Once you have cloned the repository, the general workflow below should be sufficient for getting and pushing new updates to/from the remote repository.
hg pull
- Pull the latest Mercurial updates from the server to the local repositoryhg update
- Update the local repository to include the latest updates. NOTE: You may get messages about unresolved conflicts. In these cases, you will need to manually merge the conflicting files and then run hg resolve -m FILE
to mark the file as resolved.hg externals
- For some repositories (specifically the aintno repository), there is a dependency on external repositories. Updating these repositories may be done using the HgExternals plugin and using this command.hg add FILE
- Add any newly created files to the repositoryhg commit -m MESSAGE [-u USER]
- Commit the changes to your local repository.hg push
- Push all local changes to the remote (DIG) repository. NOTE: You may need to run hg pull
and hg merge
if remote changes have been pushed by someone else, so as to not create a new branch. Mercurial will warn you if this is the case.hg rename SOURCE DEST
- Move/rename a file currently under source control. NOTE: Changes must be committed.hg remove FILE
- Remove a file currently under source control and delete the local copy. NOTE: Changes must be committed.hg revert FILE
- Revert the contents of FILE
(or restore them if the file has been deleted) to the current revision.hg tags
- List all tags in the repository.hg tag TAG
- Label the current revision of the repository with the tag TAG
hg status
- List the status of all files in the repository (that have outstanding uncommitted changes).hg diff
- List/export a diff patch of the current uncommitted repository changes to STDOUT.hg log
- List the log of changes to the repository.hg branch [BRANCH]
- List the current branch (or if BRANCH
is specified, label the next commit as belonging to the branch BRANCH
, which will then be used for all future commits derived from the next commit.hg branches
- List all (open) brancheshg init
- Create a new (local) Mercurial repository in the current directory with no commits or remote repository to push to.hg update
, hg tag
, hg diff
and hg revert
commands to jump to specific revision numbers, tags, or branches by specifying the -r REVISION/TAG/BRANCH
option. hg update
may additionally require -C
to be set to clean the repository of any changes when switching between branches.hg stat
for hg status
and hg mv
for hg rename
). Read the Mercurial documentation for more details.man
and the command hg help [TOPIC]
New Mercurial repositories may be created by any user with dig-admin rights on the CSAIL servers. Those who do may follow the instructions below. Otherwise contact Ian or Oshani and have them create the repository.
Although the CSAIL servers do have Mercurial installed, due to some versioning issues, it is not possible to create a remote repository easily on the CSAIL servers. The repository script will only work with Mercurial repositories made with version 0.92, while the command-line scripts are generally above version 1.0. Due to this, making new repositories is currently a little more involved than it should be, and instructions follow.
hg init
fs setacl . www write
, fs setacl .hg www write
and fs setacl .hg/store www write
..hg/hgrc
using the following template (filling in the appropriate blanks after the equals signs. Description, name, and contact are used to populate the columns on http://dig.csail.mit.edu/hg/)
[web] allow_push = * push_ssl = false style = gitweb description = name = contact =
../hgweb.config
under the [paths]
section, reading name=/afs/csail/group/dig/hg/new-directory
, replacing name and new-directory with the values chosen above when creating the directory and assigning a name in hgrc
.../.htaccess
to add a new RewriteCond
directive to ignore the newly created directory.New Mercurial committers may be added by any user with dig-admin rights on the CSAIL servers. Those who do may follow the instructions below. Otherwise contact Ian or Oshani and have them create your user account.
/afs/csail/group/dig/hg