特殊:Badtitle/NS100:Mercurial:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的2个中间版本) | |||
第9行: | 第9行: | ||
edit files, start/stop services in an Ubuntu | edit files, start/stop services in an Ubuntu | ||
system. It is also assumed that Ubuntu is running, you | system. It is also assumed that Ubuntu is running, you | ||
have [[RootSudo|sudo access]] and you | have [[UbuntuHelp:RootSudo|sudo access]] and you | ||
want to use Mercurial software. | want to use Mercurial software. | ||
It is also assumed you have an internet connection. | It is also assumed you have an internet connection. | ||
第23行: | 第23行: | ||
please resolve them. If you cannot resolve the issue, | please resolve them. If you cannot resolve the issue, | ||
please refer the mailing list archive of those packages. | please refer the mailing list archive of those packages. | ||
==== Installation from source ==== | |||
If you already have a version installed, remove it. | |||
<pre><nowiki> | |||
sudo apt-get remove mercurial | |||
</nowiki></pre> | |||
''You may need to `sudo apt-get purge mercurial` instead of `remove`. `Purge` will delete configuration files, which `remove` keeps.'' | |||
Get the latest tarball from http://mercurial.selenic.com/release/. We will call the file `mercurial-ver.tar.gz`, e.g. `mercurial-1.4.1.tar.gz`. Extract it to a directory: | |||
<pre><nowiki> | |||
tar xf mercurial-ver.tar.gz | |||
cd mercurial-ver/ | |||
</nowiki></pre> | |||
Install to the local directory to make sure everything works: | |||
<pre><nowiki> | |||
make local | |||
./hg debuginstall | |||
./hg version | |||
</nowiki></pre> | |||
If that's OK, use `checkinstall` (see [[UbuntuHelp:CheckInstall|CheckInstall]]) to make a .deb package. For the summary, put something descriptive like "Mercurial distributed revision control". Accepting all of the defaults is usually sufficient. | |||
<pre><nowiki> | |||
sudo checkinstall | |||
</nowiki></pre> | |||
N.B. the version must have numbers in it. If you're using a snapshot, you will probably want to put the date in there (e.g. 20091208). | |||
<pre><nowiki> | |||
0 - Maintainer: [ root@host ] | |||
1 - Summary: [ Mercurial distributed revision control ] | |||
2 - Name: [ mercurial ] | |||
3 - Version: [ 1.4.1 ] | |||
4 - Release: [ 1 ] | |||
5 - License: [ GPL ] | |||
6 - Group: [ checkinstall ] | |||
7 - Architecture: [ amd64 ] | |||
8 - Source location: [ mercurial-1.4.1 ] | |||
9 - Alternate source location: [ ] | |||
10 - Requires: [ ] | |||
11 - Provides: [ mercurial ] | |||
</nowiki></pre> | |||
If all goes well, you should have a new mercurial installed. | |||
<pre><nowiki> | |||
cd ~ # there was an hg in mercurial-ver/, remember? | |||
hg version | |||
</nowiki></pre> | |||
=== Configuration === | === Configuration === | ||
The default Mercurial installation puts a blank config file in /etc/mercurial called 'hgrc'. We will add some parameters to this file to tweak how Mercurial works. | The default Mercurial installation puts a blank config file in /etc/mercurial called 'hgrc'. We will add some parameters to this file to tweak how Mercurial works. | ||
第47行: | 第88行: | ||
This sets the default username so that your name will show up on changesets you issue, changes the text editor to nano (default is vi) and sets meld as the merge program. This also enables some useful extensions: GPG allows changesets to be cryptographically signed, while Convert allows Mercurial repositories to be created from existing CVS, SVN, or git repositories. | This sets the default username so that your name will show up on changesets you issue, changes the text editor to nano (default is vi) and sets meld as the merge program. This also enables some useful extensions: GPG allows changesets to be cryptographically signed, while Convert allows Mercurial repositories to be created from existing CVS, SVN, or git repositories. | ||
=== References === | === References === | ||
* | * [http://www.selenic.com/mercurial/wiki/index.cgi/Mercurial Mercurial Homepage] | ||
* | * [http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions Using Extensions] | ||
* | * [http://www.selenic.com/mercurial/wiki/index.cgi/GpgExtension GPG Extension] | ||
* | * [http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension Convert Extension] | ||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 23:24的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Mercurial }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/af | • {{#if: UbuntuHelp:Mercurial|Afrikaans| [[::Mercurial/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ar | • {{#if: UbuntuHelp:Mercurial|العربية| [[::Mercurial/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/az | • {{#if: UbuntuHelp:Mercurial|azərbaycanca| [[::Mercurial/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/bcc | • {{#if: UbuntuHelp:Mercurial|جهلسری بلوچی| [[::Mercurial/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/bg | • {{#if: UbuntuHelp:Mercurial|български| [[::Mercurial/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/br | • {{#if: UbuntuHelp:Mercurial|brezhoneg| [[::Mercurial/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ca | • {{#if: UbuntuHelp:Mercurial|català| [[::Mercurial/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/cs | • {{#if: UbuntuHelp:Mercurial|čeština| [[::Mercurial/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/de | • {{#if: UbuntuHelp:Mercurial|Deutsch| [[::Mercurial/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/el | • {{#if: UbuntuHelp:Mercurial|Ελληνικά| [[::Mercurial/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/es | • {{#if: UbuntuHelp:Mercurial|español| [[::Mercurial/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/fa | • {{#if: UbuntuHelp:Mercurial|فارسی| [[::Mercurial/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/fi | • {{#if: UbuntuHelp:Mercurial|suomi| [[::Mercurial/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/fr | • {{#if: UbuntuHelp:Mercurial|français| [[::Mercurial/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/gu | • {{#if: UbuntuHelp:Mercurial|ગુજરાતી| [[::Mercurial/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/he | • {{#if: UbuntuHelp:Mercurial|עברית| [[::Mercurial/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/hu | • {{#if: UbuntuHelp:Mercurial|magyar| [[::Mercurial/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/id | • {{#if: UbuntuHelp:Mercurial|Bahasa Indonesia| [[::Mercurial/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/it | • {{#if: UbuntuHelp:Mercurial|italiano| [[::Mercurial/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ja | • {{#if: UbuntuHelp:Mercurial|日本語| [[::Mercurial/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ko | • {{#if: UbuntuHelp:Mercurial|한국어| [[::Mercurial/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ksh | • {{#if: UbuntuHelp:Mercurial|Ripoarisch| [[::Mercurial/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/mr | • {{#if: UbuntuHelp:Mercurial|मराठी| [[::Mercurial/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ms | • {{#if: UbuntuHelp:Mercurial|Bahasa Melayu| [[::Mercurial/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/nl | • {{#if: UbuntuHelp:Mercurial|Nederlands| [[::Mercurial/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/no | • {{#if: UbuntuHelp:Mercurial|norsk| [[::Mercurial/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/oc | • {{#if: UbuntuHelp:Mercurial|occitan| [[::Mercurial/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/pl | • {{#if: UbuntuHelp:Mercurial|polski| [[::Mercurial/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/pt | • {{#if: UbuntuHelp:Mercurial|português| [[::Mercurial/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ro | • {{#if: UbuntuHelp:Mercurial|română| [[::Mercurial/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/ru | • {{#if: UbuntuHelp:Mercurial|русский| [[::Mercurial/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/si | • {{#if: UbuntuHelp:Mercurial|සිංහල| [[::Mercurial/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/sq | • {{#if: UbuntuHelp:Mercurial|shqip| [[::Mercurial/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/sr | • {{#if: UbuntuHelp:Mercurial|српски / srpski| [[::Mercurial/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/sv | • {{#if: UbuntuHelp:Mercurial|svenska| [[::Mercurial/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/th | • {{#if: UbuntuHelp:Mercurial|ไทย| [[::Mercurial/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/tr | • {{#if: UbuntuHelp:Mercurial|Türkçe| [[::Mercurial/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/vi | • {{#if: UbuntuHelp:Mercurial|Tiếng Việt| [[::Mercurial/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/yue | • {{#if: UbuntuHelp:Mercurial|粵語| [[::Mercurial/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/zh | • {{#if: UbuntuHelp:Mercurial|中文| [[::Mercurial/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/zh-hans | • {{#if: UbuntuHelp:Mercurial|中文(简体)| [[::Mercurial/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Mercurial | UbuntuHelp:Mercurial | {{#if: | :}}Mercurial}}/zh-hant | • {{#if: UbuntuHelp:Mercurial|中文(繁體)| [[::Mercurial/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Mercurial|:Mercurial|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Mercurial/zh | | {{#ifexist: Mercurial/zh | | {{#ifeq: {{#titleparts:Mercurial|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Mercurial|1|-1|}} | zh | | }}
This wiki document explains how to setup Mercurial on Ubuntu. The intended audience is experienced Linux users and system administrators.
Introduction
If you are new to Mercurial this section provides a quick introduction. Mercurial is a fast, lightweight Source Control Management system designed for the efficient handling of very large distributed projects.
Assumptions
It is assumed that you are aware of how to run Linux commands, edit files, start/stop services in an Ubuntu system. It is also assumed that Ubuntu is running, you have sudo access and you want to use Mercurial software. It is also assumed you have an internet connection.
Scope of this document
To install and configure Mercurial, as well as to install some useful extensions
Installation
Mercurial is included in the Universe repository - activate this repo first (if you haven't already). Once you've finished simply execute. We will also install meld, which is a graphical merge tool useful for resolving conflicting changes.
$ sudo apt-get install mercurial meld
If it fails reporting dependencies, please locate the packages and install them. If it reports any other issues, please resolve them. If you cannot resolve the issue, please refer the mailing list archive of those packages.
Installation from source
If you already have a version installed, remove it.
sudo apt-get remove mercurial
You may need to `sudo apt-get purge mercurial` instead of `remove`. `Purge` will delete configuration files, which `remove` keeps. Get the latest tarball from http://mercurial.selenic.com/release/. We will call the file `mercurial-ver.tar.gz`, e.g. `mercurial-1.4.1.tar.gz`. Extract it to a directory:
tar xf mercurial-ver.tar.gz cd mercurial-ver/
Install to the local directory to make sure everything works:
make local ./hg debuginstall ./hg version
If that's OK, use `checkinstall` (see CheckInstall) to make a .deb package. For the summary, put something descriptive like "Mercurial distributed revision control". Accepting all of the defaults is usually sufficient.
sudo checkinstall
N.B. the version must have numbers in it. If you're using a snapshot, you will probably want to put the date in there (e.g. 20091208).
0 - Maintainer: [ root@host ] 1 - Summary: [ Mercurial distributed revision control ] 2 - Name: [ mercurial ] 3 - Version: [ 1.4.1 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mercurial-1.4.1 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mercurial ]
If all goes well, you should have a new mercurial installed.
cd ~ # there was an hg in mercurial-ver/, remember? hg version
Configuration
The default Mercurial installation puts a blank config file in /etc/mercurial called 'hgrc'. We will add some parameters to this file to tweak how Mercurial works. Copy and Past the following into /etc/mercurial/hgrc:
# system-wide mercurial configuration file # See hgrc(5) for more information # User Interface settings [ui] username= Your Name <[email protected]> editor=nano merge=meld # Enabled extensions [extensions] hgext.gpg= hgext.convert= # GPG extension settings [gpg] key=<your private gpg key>
This sets the default username so that your name will show up on changesets you issue, changes the text editor to nano (default is vi) and sets meld as the merge program. This also enables some useful extensions: GPG allows changesets to be cryptographically signed, while Convert allows Mercurial repositories to be created from existing CVS, SVN, or git repositories.