Difference between revisions of "Mercurial/En"

From TuxFamilyFAQ
Jump to navigationJump to search
(→‎Basic Operations: some more operations)
m (→‎Description: update link to homepage)
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
= Description =
 
= Description =
  
[http://mercurial.selenic.com/ Mercurial] is a distributed version control system.
+
[https://www.mercurial-scm.org/ Mercurial] is a distributed version control system.
  
 
= Dependencies =
 
= Dependencies =
Line 31: Line 31:
  
 
On the panel you can choose if you want the repository to be public.
 
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)
+
By accepting it, you allow a read-only anonymous login on the repository and you allow viewing it from the [http://hg.tuxfamily.org/ hgweb].
  
 
== Configuration ==
 
== Configuration ==
Line 95: Line 95:
 
  $ hg update tip
 
  $ hg update tip
 
Alternatively, you can pull and update at the same time, using:
 
Alternatively, you can pull and update at the same time, using:
 +
$ hg pull -u
 +
 +
== Using Mercurial as an anonymous user ==
 +
 +
You can use Mercurial without logging in. You won't be able to change the repository (add or remove files).
 +
To make an anonymous checkout, type this:
 +
$ hg clone http://hg.tuxfamily.org/mercurialroot/YOURPROJECT/REPOSITORYNAME
 +
 +
Anonymous people can also check for new versions by typing:
 
  $ hg pull -u
 
  $ hg pull -u

Latest revision as of 17:16, 15 August 2016

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 hgweb.

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

Using Mercurial as an anonymous user

You can use Mercurial without logging in. You won't be able to change the repository (add or remove files). To make an anonymous checkout, type this:

$ hg clone http://hg.tuxfamily.org/mercurialroot/YOURPROJECT/REPOSITORYNAME

Anonymous people can also check for new versions by typing:

$ hg pull -u