Mercurial is used when xen is installed in source code. Google has been around for a long time, focusing on source code installation, and then two simple methods.
1. Download source code
[Root @ localhost mercurial-1.4.1] wget http://mercurial.selenic.com/release/mercurial-1.4.1.tar.gz
2. Compile and install
[Root @ localhost mercurial-1.4.1] # Make all
[Root @ localhost mercurial-1.4.1] # make install-home
3. Installation check
[Root @ localhost mercurial-1.4.1] Hg debuginstall
Abort: Couldn't find mercurial libraries in...
[Root @ localhost mercurial-1.4.1] export pythonpath =$ {home}/lib/Python
Run Hg debuginstall again.
[Root @ localhost mercurial-1.4.1] # Hg debuginstall
Checking encoding (UTF-8 )...
Checking extensions...
Checking templates...
Checking patch...
Checking commit editor...
Checking username...
No username supplied (see "Hg help config ")
(Specify a username in your. hgrc file)
1 problems detected, please check your install!
This is because of the configuration file. In the source code, the contrib folder provides a sample. hgrc, which can be copied and modified.
[Root @ localhost mercurial-1.4.1] # cd contrib/
[Root @ localhost contrib] # cp sample. hgrc/root/. hgrc
[Root @ localhost contrib] # Vim/root/. hgrc
Here we will change it:
### Show changed files and be a bit more verbose if true
# Verbose = true
### Username data to appear in comits
### It usually takes the form: Joe User <joe.user@host.com>
Username = zhuliting <zhuliting@example.com> // modify this row only.
### --- Extensions
[Note] When the configuration file is modified incorrectly, run Hg debuginstall.
Hg: config error at/root/. hgrc: 12: 'username = Joe who <j.user@example.com>'
Run Hg debuginstall again. The prompt will be displayed.
[Root @ localhost contrib] # Hg debuginstall
Checking encoding (UTF-8 )...
Checking extensions...
Checking templates...
Checking patch...
Checking commit editor...
Checking username...
No problems detected
Run Hg.
[Root @ localhost contrib] # Hg
Distributed Software Configuration Management Tool-Mercury
Basic commands:
Add add the specified files on the next commit
Annotate show Changeset information by line for each file
Clone make a copy of an existing repository
Commit commit the specified files or all outstanding changes
Diff diff repository (or selected files)
Export dump the header and diffs for one or more changesets
Forget forget the specified files on the next commit
Init create a new repository in the given directory
Log show revision history of entire repository or files
Merge merge working directory with another revision
Pull changes from the specified source
Push push changes to the specified destination
Remove remove the specified files on the next commit
Serve export the repository via HTTP
Status show changed files in the working directory
Summary summarize working directory state
Update working directory
Use "Hg help" to obtain a list of all commands, or "Hg-V" to obtain detailed information.
Mercurial has been installed successfully. The next time you use the Hg command, you must first set
[Root @ localhost mercurial-1.4.1] export pythonpath =$ {home}/lib/Python
You can also create a soft link.
[Note] other simple installation methods:
1. When installing the software, if it is only a simple application, you can install the compiled Binary Package, that is, yum install mercurial. My centos 5.4 version can also be successfully installed, but it won't work for the first few times. You can install rpmforge first.
[Root @ localhost ~] # Wget ftp://ftp.univie.ac.at/systems/linux/dag/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
[Root @ localhost ~] # Rpm-uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Then Yum install mercurial