python:mercurial

文書の過去の版を表示しています。


Mercurial - 分散バージョン管理システム

ここでは Python と pip の導入が完了していることを前提とする。

Python のインストール
easy_install、setuptools、pip - パッケージ管理

CentOS の場合は python-devel をインストールしておく。

$ sudo yum install python-devel
$ sudo pip install mercurial
$ hg version
Mercurial - 分散構成管理ツール(バージョン 3.4.1)
(詳細は http://mercurial.selenic.com を参照)

Copyright (C) 2005-2015 Matt Mackall 他
本製品はフリーソフトウェアです。
頒布条件に関しては同梱されるライセンス条項をお読みください。
市場適合性や特定用途への可否を含め、 本製品は無保証です。
vi ~/.hgrc
[ui]
username = Tomoyan <tomoyan@example.com>

既存のディレクトリでリポジトリを作成する。

$ mkdir repos
$ cd repos
$ hg init

新たにリポジトリのディレクトリを作成する。

$ hg init repos
$ vi .hgignore
# Shell 形式パターンマッチ
syntax: glob
 
*.pyc
# 正規表現パターンマッチ
syntax: regexp
 
^\.git/
$ hg add file.txt
$ hg status
A file.txt
$ hg commit
$ hg diff
$ hg revert file.txt
$ hg rollback
$ hg log

ssh経由でリモートリポジトリをローカルに複製する。

$ hg clone ssh://user@server:port//var/hg/hoge/fuga my-fuga
$ hg pull
$ hg update

作業領域の変更を破棄する場合

$ hg update -C
$ hg push ssh://user@server:port//var/hg/hoge/fuga

※push先にリポジトリが存在している必要がある。存在しない場合は作成するかcloneしておくこと。

.hg/hgrc に以下の記載があるなら省略できる。

[paths]
default = ssh://user@server:port//var/hg/hoge/fuga
$ hg push


サーバーでリポジトリを作成する場合。

$ hg init fuga


クライアントからサーバーへクローンする場合。

$ hg clone . ssh://user@server:port//var/hg/hoge/fuga

日本語では、gcc: エラー: /usr/lib/rpm/redhat/redhat-hardened-cc1: そのようなファイルやディレクトリはありません
英語では、g++: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory が発生する。

redhat-rpm-config パッケージをインストールしてから行う。

$ sudo dnf install redhat-rpm-config
  • python/mercurial.1452406460.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)