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 firstname.lastname@example.org
where 'email@example.com' 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 a few minutes, your repository should appear on
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.
- Once it's visible, clone this repository in a temporary location.
- Initialize a patch queue, if you haven't already.
- Copy the hgrc from your temporary clone to your patches .hg directory
ssh hg.mozilla.org clone my-repo-patches # Wait a few minutes for repository to become visible cd /tmp hg clone http://hg.mozilla.org/users/your-hg_username.domain/my-repo-patches cd $MY_MOZILLA_SOURCE_DIRECTORY hg qinit -c cp /tmp/my-repo-patches/.hg/hgrc .hg/patches/.hg
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:
hg push ssh://hg.mozilla.org/users/your-hg_username.domain/my-repo1
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_username.domain/my-repo1
Bogus error message
You will get the following bogus error message each time you ask
hg to do anything that requires a command to be sent to the server.
remote: Could not chdir to home directory : No such file or directory
Just ignore it.