When working with Mercurial, it is often nice to publish your changes on a server so others can examine and work with them as well. If you have commit access to CVS, you should have an LDAP account, and that should allow you to push to hg.mozilla.org. If you do, you can create clones in the
/users directory and share them with others.
So you don't need to type your username every time, add these lines to
Host hg.mozilla.org User email@example.com
where 'firstname.lastname@example.org' is simply your CVS username with the "%" character replaced with the "@" character.
Creating a Repository
It is a relatively easy process to create your own repository. It will be visible via HTTP at
To do this, run the following command. Use the same command regardless of whether you want to clone an existing repository or create a new, empty one.
ssh hg.mozilla.org clone my-repo1
my-repo1 is the name of the new repository you want to create, not the repository you are trying to clone from.
Running the above ssh command will run an interactive script, prompting you to make some choices (about which repository you want to clone from). It is by and large self-explanatory. When the script is finished, ssh will exit. After 5-10 minutes, your repository should appear on
Editing your personal repository
Once you have created your mercurial repository, you can edit its description. This description will show up when people visit http://hg.mozilla.org/users/your-hg_username.domain. The process is similar to creating a brand new repository, instead of using the clone action, use the "edit" action. The "edit" action also lets you delete your repository. Please note that the delete action is irreversible.
~ $ssh hg.mozilla.org edit my-repo1 0) Exit. 1) Delete the repository. 2) Edit the description. What would you like to do? 0
Creating an Mq Patch Queue Repository
Here's how to publish an Mq patch-queue repository:
- Create a new empty repository (say, "
my-repo-patches") on hg.mozilla.org, as directed above.
- Verify that the repository is visible at http://hg.mozilla.org/users/your-hg_...y-repo-patches
- Initialize a patch queue, if you haven't already, with
hg qinit -c(option
-censures that your patch queue is itself a hg repository)
- Create a hgrc for your patch queue (at
.hg/patches/.hg/hgrc) with these contents:
[paths] default = http://hg.mozilla.org/users/your-hg_username.domain/my-repo-patches default-push = ssh://hg.mozilla.org/users/your-hg_username.domain/my-repo-patches
Examining Clones Via the Web
It may take a while for your clone to show up because of some caching mechanisms that have been put in place. It should show up pretty quickly though, and you'll be able to browse history via a web interface.
Others can also pull changes via http:
hg clone http://hg.mozilla.org/users/your-hg_username.domain/my-repo1
To push changes, use ssh:
Or, if you just want to push your patch queue:
cd .hg/patches hg commit -m "Some message" hg push ssh://hg.mozilla.org/users/your-hg_u...omain/my-repo1
In either case, you may also want to add that path to the repository's hgrc, so you don't have to type it every time. Put something like this in
[paths] default-push = ssh://hg.mozilla.org/users/your-hg_u...omain/my-repo1
Pulling your changes
You may wish to use this repository to share changes between machines. For this, start by doing the exact same setup on the other machine. In other words, if you have pulled mozilla-central from your first machine, pull it from the second machine. If you have created a queue on the first machine, create a queue on the second machine, etc.
Then, to pull the complete repo:
Or, to pull only the patch queue:
cd .hg/patches hg pull ssh://hg.mozilla.org/users/your-hg_u...omain/my-repo1