了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。
-- Moshe Zadka
python2 -m virtualenv mercurial-env
./mercurial-env/bin/pip install mercurial
$ source mercurial-env/bin/activate
(mercurial-env)$ mkdir test-dir
(mercurial-env)$ cd test-dir
(mercurial-env)$ hg init
(mercurial-env)$ hg status
(mercurial-env)$
(mercurial-env)$ echo 1 > one
(mercurial-env)$ echo 2 > two
(mercurial-env)$ hg status
? one
? two
(mercurial-env)$ hg addremove
adding one
adding two
(mercurial-env)$ hg commit -m 'Adding stuff'
(mercurial-env)$ hg log
changeset: 0:1f1befb5d1e9
tag: tip
user: Moshe Zadka <[moshez@zadka.club][4]>
date: Fri Mar 29 12:42:43 2019 -0700
summary: Adding stuff
from mercurial import registrar
from mercurial.i18n import _
cmdtable = {}
command = registrar.command(cmdtable)
@command('say-hello',
[('w', 'whom', '', _('Whom to greet'))])
def say_hello(ui, repo, `opts):
ui.write("hello ", opts['whom'], "\n")
`$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py`
$ cat >> .hg/hgrc
[extensions]
hello_ext =
(mercurial-env)$ hg say-hello --whom world
hello world
欢迎光临 邳州信息网 (https://www.pzxxw.com/) | Powered by Discuz! X3.4 |