MacOS X 安装Mercurial

Mercurial

以下是来自Mercurial官网的介绍

Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.

Mercurial和当前广泛应用的git和svn都是源码版本管理工具。

Mercurial 是python编写的,安装前需要先安装好 python

  • 检查python是否安装 python --version,以下是我使用的版本
Python 2.7.10

Mercurial 官网下载得到 mercurial-4.5 软件包

  • 解压到合适的目录
  • 进入主目录 cd mercurial-4.5
  • make install 进行安装

安装过程中可能出现 docutils 模块缺失

abort: couldn’t generate documentation: docutils module is missing

从 http://docutils.sourceforge.net/ 下载docutils

docutils的安装
* tar -zxf docutils-0.14.tar.gz
* cd docutils-0.14
* sudo python setup.py install

重新 make install 安装Mercurial

hg debuginstall 检查安装情况

checking encoding (UTF-8)...
checking Python executable (/usr/bin/python)
checking Python version (2.7.10)
checking Python lib (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)...
checking Python security support (sni,tls1.0,tls1.1,tls1.2)
checking Mercurial version (4.5)
checking Mercurial custom build ()
checking module policy (c)
checking installed modules (/usr/local/lib/python2.7/site-packages/mercurial)...
checking registered compression engines (bz2, bz2truncated, none, zlib, zstd)
checking available compression engines (bz2, bz2truncated, none, zlib, zstd)
checking available compression engines for wire protocol (zstd, zlib, bz2, none)
checking "re2" regexp engine (missing)
checking templates (/usr/local/lib/python2.7/site-packages/mercurial/templates)...
checking default template (/usr/local/lib/python2.7/site-packages/mercurial/templates/map-cmdline.default)
checking commit editor... (vi)
checking username...
 no username supplied
 (specify a username in your configuration file)
1 problems detected, please check your install!

hg 查看hg命令帮助

Mercurial Distributed SCM

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 another revision into working directory
 pull          pull changes from the specified source
 push          push changes to the specified destination
 remove        remove the specified files on the next commit
 serve         start stand-alone webserver
 status        show changed files in the working directory
 summary       summarize working directory state
 update        update working directory (or switch revisions)

(use 'hg help' for the full list of commands or 'hg -v' for details)

来自官网的快速上手,使用hg命令clone一把官网提供的hello repo

hg clone https://www.mercurial-scm.org/repo/hello

destination directory: hello
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
new changesets 0a04b987be5a:82e55d328c8c
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

Everything is fine and now you are good to go!

你可能感兴趣的:(MacOS X 安装Mercurial)