Mercurial/En

From TuxFamilyFAQ
Revision as of 06:24, 10 April 2010 by Guillaumito (talk | contribs) (→‎Basic Operations: some more operations)
Jump to navigationJump to search

Mercurial repository




Description

Mercurial is a distributed version control system.

Dependencies

Creating the Mercurial repository

  • Go on the control panel
  • Select the project where you want to add a Mercurial repository
  • Choose the name of your repository
  • Validate

creating tips

  • Fill the description field to avoid problems with the moderation team ;)

Moderation

Your repository will be subject to moderation, see here

How to administrate it (panel)

On the panel you can choose if you want the repository to be public. By accepting it, you allow a read-only anonymous login on the repository and you allow viewing it from the web (coming soon)

Configuration

How to handle group rights

This object can be shared with your group using the ACL

How to destroy it

  • Log into the panel
  • click on the group corresponding to your project
  • click on your Mercurial repository
  • click on destroy

How to use it

Basic Operations

Cloning

$ hg clone ssh://YOURUSER@hg.tuxfamily.org//mercurialroot/YOURPROJECT/REPOSITORYNAME

with YOURUSER, YOURPROJECT and REPOSITORYNAME set to the correct values. The double slash between the domain name and the path is not a typo, without it, Mercurial assumes path to be relative to YOURUSER's home directory.

Adding, removing files, updating your repository

Adding files

Go into your local repository

$ cd REPOSITORYNAME

let's create a file named 'file'

$ touch file

Then to add the file to your repository, just type:

$ hg add file

Now, you can commit by typing:

$ hg commit file

to only commit the new file or

$ hg commit

to commit your whole repository.

Once the commit is done, you can push everything on the server:

$ hg push

For directories, we will do the same

$ hg add directory
$ hg commit directory
$ hg push

Removing a file

To remove a file, just type :

$ hg remove file
$ hg commit
$ hg push

Updating your repository

When working in team, it can be useful to update your local repository:

$ hg pull

The pull operation only updates your repository and not your working copy, to update it, type:

$ hg update tip

Alternatively, you can pull and update at the same time, using:

$ hg pull -u