Revision 52503 of Installing Mercurial

  • Revision slug: Installing_Mercurial
  • Revision title: Installing Mercurial
  • Revision id: 52503
  • Created:
  • Creator: Dholbert
  • Is current revision? No
  • Comment Replace broken interwiki markup with direct link to wikimo.; 13 words removed

Revision Content

{{ Note("If you have not yet read the Mercurial basics do so now, or see Mercurial for other resources.") }}

Installing

 

On Windows:
Mercurial comes with MozillaBuild, in the folder 'hg'.  See also wikimo:Mercurial on Windows.

 

Other systems:
If you use apt-get, emerge, port, yast, or yum to install software, just do the usual. If this gives you an old version (pre-1.0 -- check with hg version), you can update it using easy_install as follows (using apt-get in this example):
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U mercurial

Otherwise, the Mercurial binary packages are for you.

Merge program

After installing, choose a merge program. Seriously. Do it now. If you don't, Mercurial will choose one for you and spring it on you when you least expect it.

A reasonable thing to do is to set ui.merge=internal:merge in the Mercurial configuration file (see below), which makes Mercurial try to merge changes and add the conflict markers (a la CVS) to the files that couldn't be merged.

Under Ubuntu, you can install meld package, then in in the Mercurial configuration file (see below) set ui.merge=meld

You can see the list of merge conflicts by looking for "merging ... failed!" in the update output.

Configuration

You should configure Mercurial before pulling the code. Your mercurial configuration file should have at least the following settings:

[ui]
username = Your Real Name <user@example.com>
merge = your-merge-program (or internal:merge)
 
[diff]
git = 1

[defaults]
diff=-p -U 8

On Windows, these settings can be added to C:\Program Files\Mercurial\Mercurial.ini, or C:\mozilla-build\hg\Mercurial.ini if you installed MozillaBuild. If you install tortoiseHg, edit C:\Program Files\TortoiseHg\Mercurial.ini. On UNIX-like systems, they should be in your $HOME/.hgrc file. (Sure wish these config options where explained...) (More guessing: if you use msys shell, follow the unix instructions). Under Ubuntu, the config file will be in /etc/mercurial.

You can configure the editor to use for commit messages using the editor option in the {{ mediawiki.external('ui') }} section or by setting the EDITOR environment variable.

{{ languages( { "fr": "fr/Installation_de_Mercurial" } ) }}

Revision Source

<p>{{ Note("If you have not yet read the <a href='\"en/Mercurial_basics\"'>Mercurial basics</a> do so now, or see <a href='\"en/Mercurial\"'>Mercurial</a> for other resources.") }}</p>
<h2 name="Installing">Installing</h2>
<p> </p>
<dl> <dt>On Windows:</dt> <dd>Mercurial comes with <a href="/En/Developer_Guide/Build_Instructions/Windows_Prerequisites#MozillaBuild" title="en/Windows_Build_Prerequisites#MozillaBuild">MozillaBuild</a>, in the folder 'hg'.  See also <a class="link-https" href="https://wiki.mozilla.org/Mercurial_on_Windows" title="https://wiki.mozilla.org/Mercurial_on_Windows">wikimo:Mercurial on Windows</a>. <p> </p> </dd> <dt>Other systems:</dt> <dd>If you use <code>apt-get</code>, <code>emerge</code>, <code>port</code>, <code>yast</code>, or <code>yum</code> to install software, just do the usual. If this gives you an old version (pre-1.0 -- check with <code>hg version</code>), you can update it using <code>easy_install</code> as follows (using <code>apt-get</code> in this example): <pre class="eval">sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U mercurial
</pre> <p>Otherwise, the <a class="external" href="http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages">Mercurial binary packages</a> are for you.</p> </dd>
</dl>
<h3 name="Merge_program">Merge program</h3>
<p>After installing, <strong>choose a <a class="external" href="http://www.selenic.com/mercurial/wiki/index.cgi/MergeProgram">merge program</a></strong>. Seriously. Do it now. If you don't, Mercurial will choose one for you and spring it on you when you least expect it.</p>
<p>A reasonable thing to do is to set <code>ui.merge=internal:merge</code> in the Mercurial configuration file (see below), which makes Mercurial try to merge changes and add the conflict markers (a la CVS) to the files that couldn't be merged.</p>
<p>Under Ubuntu, you can install meld package, then in in the Mercurial configuration file (see below) set <code>ui.merge=meld</code></p>
<p>You can see the list of merge conflicts by looking for "merging ... failed!" in the update output.</p>
<h3 name="Configuration">Configuration</h3>
<p>You should configure Mercurial before pulling the code. Your mercurial configuration file should have at least the following settings:</p>
<pre class="eval">[ui]
username = Your Real Name &lt;<a class=" link-mailto" href="mailto:user@example.com" rel="freelink">user@example.com</a>&gt;
merge = <em>your-merge-program</em> (or internal:merge)
 
[diff]
git = 1

[defaults]
diff=-p -U 8
</pre>
<p>On Windows, these settings can be added to <code>C:\Program Files\Mercurial\Mercurial.ini</code>, or <code>C:\mozilla-build\hg\Mercurial.ini</code> if you installed MozillaBuild. If you install tortoiseHg, edit <code>C:\Program Files\TortoiseHg\Mercurial.ini.</code> On UNIX-like systems, they should be in your <code>$HOME/.hgrc</code> file. <em>(Sure wish these config options where explained...) (More guessing: if you use msys shell, follow the unix instructions).</em> Under Ubuntu, the config file will be in /etc/mercurial.<em><br>
</em></p>
<p>You can configure the editor to use for commit messages using the <code>editor</code> option in the <code>{{ mediawiki.external('ui') }}</code> section or by setting the <code>EDITOR</code> environment variable.</p>
<p>{{ languages( { "fr": "fr/Installation_de_Mercurial" } ) }}</p>
Revert to this revision