Revision 52547 of Creating Mercurial User Repositories

  • Revision slug: Creating_Mercurial_User_Repositories
  • Revision title: Creating Mercurial User Repositories
  • Revision id: 52547
  • Created:
  • Creator: Cbarrett
  • Is current revision? No
  • Comment /* Creating a Clone */

Revision Content

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.

Configuring ssh

So you don't need to type your username everytime, Add these lines to ~/.ssh/config:

Host hg.mozilla.org
User your-hg@username.domain

Creating a Clone

It is a relatively easy process to create your own clone. It will be visible via HTTP at http://hg.mozilla.org/users/your-hg_username.domain/my-clone1.

To do this, run the following command:

ssh hg.mozilla.org clone my-clone1

my-clone1 is the name of the new clone 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.

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-clone1

Pushing Changes

To push changes, use ssh:

hg push ssh://hg.mozilla.org/users/your-hg_username.domain/my-clone1

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 .hg/hgrc:

[paths]
default-push: ssh://hg.mozilla.org/users/your-hg_username.domain/my-clone1

Revision Source

<p>
</p><p>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 <code>/users</code> directory and share them with others.
</p>
<h3 name="Configuring_ssh"> Configuring <code>ssh</code> </h3>
<p>So you don't need to type your username everytime, Add these lines to <code>~/.ssh/config</code>:
</p>
<pre>Host hg.mozilla.org
User your-hg@username.domain
</pre>
<h3 name="Creating_a_Clone"> Creating a Clone </h3>
<p>It is a relatively easy process to create your own clone. It will be visible via HTTP at <code>http://hg.mozilla.org/users/your-hg_username.domain/my-clone1</code>.
</p><p>To do this, run the following command:
</p>
<pre>ssh hg.mozilla.org clone my-clone1
</pre>
<p><code>my-clone1</code> is the name of the <b>new clone you want to create</b>, not the repository you are trying to clone from. 
</p><p>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.
</p>
<h3 name="Examining_Clones_Via_the_Web"> Examining Clones Via the Web </h3>
<p>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.
</p><p>Others can also pull changes via http:
</p>
<pre>hg clone http://hg.mozilla.org/users/your-hg_username.domain/my-clone1
</pre>
<h3 name="Pushing_Changes"> Pushing Changes </h3>
<p>To push changes, use ssh:
</p>
<pre>hg push ssh://hg.mozilla.org/users/your-hg_username.domain/my-clone1
</pre>
<p>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 <code>.hg/hgrc</code>:
</p>
<pre>[paths]
default-push: ssh://hg.mozilla.org/users/your-hg_username.domain/my-clone1
</pre>
Revert to this revision