1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changes between Version 21 and Version 22 of Mercurial

06/26/13 16:02:57 (10 months ago)
ctsai (IP:



  • Mercurial

    v21 v22  
    3 '''''Note:''''' This documentation is written for the Classic !SourceForge system. The documentation for Mercurial on the !SourceForge 2.0 Beta system is available [http://sourceforge.net/p/forge/documentation/Mercurial%20-%20Beta/ here]. 
     3'''''Note:''''' This documentation is written for the Classic !SourceForge system. The documentation for Mercurial on the New !SourceForge  system is available [http://sourceforge.net/p/forge/documentation/Mercurial here]. 
    5 Not sure if you have a Classic or Beta project? See [http://sourceforge.net/p/forge/documentation/Classic%20vs%20Beta%20projects/ this guide]. 
    7 = What is Mercurial? = 
    9 [http://mercurial.selenic.com/ Mercurial (hg)] is a [wiki:"What is Source Code Management?" Source Code Management] (SCM), a tool for software developers which supports collaborative development of software within a team, and the tracking of changes to software source code over time. 
    11 Mercurial is used by developers, and advanced users who need the very latest changes to the software (before releases occur).  Software users generally do not need Mercurial; typically they will [wiki:"Release files for download" download official file releases] made available by the project instead. 
    13 Developers should familiarize themselves with Mercurial by reading the [http://hgbook.red-bean.com/hgbook.html Mercurial Documentation]. 
    15 = Modern SCM facilities = 
    17 Here's a nice writeup of why you should consider using a Distributed Version Control System (DVCS), and a comparison of the major DVCSs: http://www.infoq.com/articles/dvcs-guide 
    19 = Features = 
    21 [wiki:"What is SourceForge.net?" SourceForge.net] provides the following features in its [wiki:"Mercurial#What is Mercurial?" Mercurial] offering: 
    23  * All 1.4.1 features of Mercurial are supported. 
    24  * [wiki:"Mercurial#Access" Developer (read/write) access] is provided via ssh. 
    25  * [wiki:"Mercurial#Access" anonymous (read-only) access] are provided via hgweb over HTTP ("!http://"). 
    26  * Several Mercurial clients are supported, including: 
    27     * The official Mercurial client (MS Windows, Mac OS X, Linux, BSD). 
    28     * The Windows shell extention client, TortoiseHG (MS Windows). 
    29  * Repositories may be viewed via web browser using the [wiki:"Mercurial Web repository browser" hgweb]. 
    30  * Existing repositories may be imported via a normal Mercurial push (since Mercurial is a distributed SCM). 
    31  * [wiki:"Mercurial permission management" Repository access may be granted or revoked from a developer using the Project Admin interface]. 
    32  * [wiki:"Mercurial#backups" Repository backups and mirroring] may be performed using rsync or Mercurial clone. 
    33  * Service usage is not restricted by [wiki:"Disk quotas" quotas]. 
    34  * Multiple repositories are supported. 
    36 = Management = 
    38 Mercurial service may be enabled for your project as follows: 
    39  1. Login as a project administrator and go to the Develop page for your project. 
    40  1. Select the Project Admin menu, and click on "Feature Settings".  
    41  1. Select "Available Features". 
    42  1. Select the checkbox to the left of the "Mercurial" heading. Your repository will be instantly enabled. 
    44 Once Mercurial has been enabled, you may wish to [wiki:"Mercurial permission management" adjust permission grants] for your users, if you need to disable one or more user's ability to make changes in the Mercurial repository. 
    46 The standard way to modify the contents of your repository is using a Mercurial client as detailed in [http://hgbook.red-bean.com/hgbookch2.html#x6-310002.2 Distributed revision control with Mercurial].  Refer to [wiki:"Mercurial#GettingStarted" the Getting Started section] for how to make your first commit to your new repository. 
    48 Administrators may also manually manipulate their repository via the site [wiki:"Shell service" "interactive shell service"].  
    50 We strongly recommend that when modifying a repository, other committers be notified of the direct edit window and that you make your own backups prior to editing the content so you can restore it readily yourself in the case of an accident.  
    52 = Access = 
    54 To access a Mercurial repository, configure your Mercurial client as follows (replace PROJECTNAME with the UNIX group name of the project, and REPONAME as the name of the Mercurial repository): 
    56  * !http://PROJECTNAME.hg.sourceforge.net:8000/hgroot/PROJECTNAME/REPONAME '''''(read-only)''''' 
    57  * !ssh://USERNAME@PROJECTNAME.hg.sourceforge.net/hgroot/PROJECTNAME/REPONAME '''''(read/write)''''' 
    59 The default repository name is the same as the project's UNIX group name, e.g  
    61  * !ssh://USERNAME@PROJECTNAME.hg.sourceforge.net/hgroot/PROJECTNAME/PROJECTNAME 
    63 ~~For those developers who have Mercurial access enabled to more than 16 projects, you may need to include your PROJECTNAME as a part of the USERNAME (appended after a comma) in order to work around a Linux permission limitation:~~ 
    65  * ~~!ssh://USERNAME,PROJECTNAME@PROJECTNAME.hg.sourceforge.net/hgroot/PROJECTNAME/REPONAME '''''(read/write)'''''~~ 
    67 ''As of 2012-02-06, this is no longer necessary. While it will still work for the time being, we encourage that users stop using the "USERNAME,PROJECTNAME" format.'' 
    69 == Authentication == 
    71 The read-only access does not prompt for a password. 
    73 The read/write access uses your ssh password or ssh key to authorize your access.  To perform write operations, your project administrator must have [wiki:"Mercurial permission management" granted you write access to the repository]. 
    75 == Getting Started == 
    77 '''Note:''' - For all examples below, "PROJECTNAME" represents a !SourceForge.net project UNIX name and "USERNAME" represents your !SourceForge.net [wiki:"Register a user account" user account]. 
    79 Your project's Mercurial repository will be completely empty at the start, but since Mercurial allows you to clone a repository with no content, you can do a clone to get started: 
    80 {{{ 
    81 hg clone ssh://USERNAME@PROJECTNAME.hg.sourceforge.net/hgroot/PROJECTNAME/PROJECTNAME 
    82 }}} 
    84 That will create a PROJECTNAME directory with the hgrepository inside the .hg subdirectory.  If you're starting fresh, use whatever combination of "'''hg add'''" and "'''hg commit'''" commands you want to create one or more commits in your local repository.  When you are ready, run "'''hg push'''" to push your commits to our server. 
    86 Users should commit to their project repository using their !SourceForge.net username or email address (!USERNAME@users.sourceforge.net). Several methods are supported for configuring this, please refer to the [http://hgbook.red-bean.com/hgbookch2.html#x6-430002.7.1 Mercurial Documentation] for the supported methods. 
    88 = Creating Multiple Repositories = 
    90 To create a new repository, you need to access the [wiki:"Shell service"], then follow these steps: 
    92  1. Navigate to your repository 
    93     a. `cd /home/scm_hg/P/PR/PROJECTUNIXNAME` 
    94       * PROJECTUNIXNAME is the UNIX name of your project 
    95       * P represents the first letter of that name, and PR the first two letters of the name. 
    96  1. Run `mkdir DIRNAME` (where DIRNAME represents the name of the repository to be created) 
    97     * This creates a new directory with the name you want for the repository. 
    98  1. Run `hg init DIRNAME` 
    99     * This will initialize a new repository at that directory 
    100  1. Run `chmod -R g+w DIRNAME` 
    101     * This will set the permissions on the repository so that all project members with Mercurial Access can write to it. 
    103 Notes: Developers should not nest directories / repositories.  Directories should only be created the top level directory of repository.  Be sure to make backups prior to editing your repository contents. 
    105 = Backups = 
    107 !SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure.  We encourage projects to make their own backups of Mercurial data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team. 
    109 Backups of a Mercurial repository may be made using [wiki:"Using rsync for backups" rsync]. 
    111 Example (replace PROJECTNAME with the UNIX group name of your project): 
    112 {{{ 
    113 rsync -av PROJECTNAME.hg.sourceforge.net::hgroot/PROJECTNAME/* . 
    114 }}} 
     5As we've migrated to the New SourceForge platform, the rest of this document has been removed to reduce confusion. If these historical docs are needed for reference, see an [https://sourceforge.net/apps/trac/sourceforge/wiki/Mercurial?action=history older revision of this page] 
    1167= Getting Help =