差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン | |||
python:mercurial [2024/03/14 09:07] – [コミット] ともやん | python:mercurial [2024/03/14 09:30] (現在) – ともやん | ||
---|---|---|---|
行 230: | 行 230: | ||
==== 差分表示 ==== | ==== 差分表示 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg diff | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== 編集取り消し ==== | ==== 編集取り消し ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg revert file.txt | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== コミット取り消し ==== | ==== コミット取り消し ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg rollback | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== コミットログ表示 ==== | ==== コミットログ表示 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg log | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== リモートリポジトリの複製 ==== | ==== リモートリポジトリの複製 ==== | ||
行 258: | 行 266: | ||
==== リモートリポジトリの変更取得 ==== | ==== リモートリポジトリの変更取得 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg pull | + | <WRAP color_command>< |
- | $ hg update | + | <font color="# |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </ | ||
作業領域の変更を破棄する場合 | 作業領域の変更を破棄する場合 | ||
- | <code> | + | <WRAP color_term> |
- | $ hg update -C | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </ | ||
+ | </WRAP> | ||
==== リモートリポジトリへ変更反映 ==== | ==== リモートリポジトリへ変更反映 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg push ssh:// | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
※push 先にリポジトリが存在している必要がある。存在しない場合は作成しておくこと。\\ | ※push 先にリポジトリが存在している必要がある。存在しない場合は作成しておくこと。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ ssh user@server -p22 hg init / | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
- | .hg/hgrc に以下の記載があるなら省略できる。 | + | < |
- | < | + | <WRAP color_term> |
+ | <WRAP color_mincode> | ||
[paths] | [paths] | ||
default = ssh:// | default = ssh:// | ||
- | </ | + | </code></ |
- | <code> | + | <WRAP color_command>< |
- | $ hg push | + | <font color="# |
- | </code> | + | </pre></ |
+ | </WRAP> | ||
サーバーでリポジトリを作成する場合。\\ | サーバーでリポジトリを作成する場合。\\ | ||
クライアントからサーバーへクローンすることもできるが...\\ | クライアントからサーバーへクローンすることもできるが...\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ hg init fuga | + | <WRAP color_command>< |
- | $ hg clone . ssh:// | + | <font color="# |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== git を Mercurial へリポジトリ変換 ==== | ==== git を Mercurial へリポジトリ変換 ==== | ||
convert エクステンションを有効化する。\\ | convert エクステンションを有効化する。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ vi ~/.hgrc | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | <file ini ~/.hgrc> | + | </pre></ |
+ | <WRAP color_mincode>< | ||
[extensions] | [extensions] | ||
convert = | convert = | ||
- | </ | + | </file></ |
+ | </WRAP> | ||
git を Mercurial へ変換\\ | git を Mercurial へ変換\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ hg convert [repository] [new-repository] | + | <WRAP color_command>< |
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
変換先リポジトリ new-repository の初期化中 | 変換先リポジトリ new-repository の初期化中 | ||
変換元リポジトリの走査中... | 変換元リポジトリの走査中... | ||
行 311: | 行 337: | ||
9625 Initial structure | 9625 Initial structure | ||
〜省略〜 | 〜省略〜 | ||
- | $ cd new-repository | + | </ |
- | $ hg update | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | <font color="# | ||
+ | </pre></ | ||
+ | </WRAP> | ||
==== Subversion のリポジトリ を Mercurial へリポジトリ変換 ==== | ==== Subversion のリポジトリ を Mercurial へリポジトリ変換 ==== | ||
hg convert で svn を Mercurial に変換する。\\ | hg convert で svn を Mercurial に変換する。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ hg convert _wxHexEditor-v0.23-src_svn _wxHexEditor-v0.23-src_hg | + | <WRAP color_command>< |
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
変換先リポジトリ _wxHexEditor-v0.23-src_hg の初期化中 | 変換先リポジトリ _wxHexEditor-v0.23-src_hg の初期化中 | ||
変換元リポジトリの走査中... | 変換元リポジトリの走査中... | ||
並べ替え中... | 並べ替え中... | ||
変換中... | 変換中... | ||
- | $ cd _wxHexEditor-v0.23-src_hg | + | </ |
- | $ hg update | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | <font color="# | ||
+ | </pre></ | ||
+ | </WRAP> | ||
=== Subversion のリポジトリがリモートにしかない場合 === | === Subversion のリポジトリがリモートにしかない場合 === | ||
git-svn を使って svn を一度 git に変換する。\\ | git-svn を使って svn を一度 git に変換する。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo dnf install git-svn | + | <WRAP color_command>< |
- | $ git svn clone https:// | + | <font color="# |
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
Initialized empty Git repository in / | Initialized empty Git repository in / | ||
A testfile | A testfile | ||
行 342: | 行 380: | ||
https:// | https:// | ||
creating empty directory: mhash/ | creating empty directory: mhash/ | ||
- | </code> | + | </pre></ |
+ | </ | ||
hg convert で git を Mercurial に変換する。\\ | hg convert で git を Mercurial に変換する。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ hg convert wxHexEditor-v0.23-src_git wxHexEditor-v0.23-src_hg | + | <WRAP color_command>< |
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
変換先リポジトリ wxHexEditor-v0.23-src_hg の初期化中 | 変換先リポジトリ wxHexEditor-v0.23-src_hg の初期化中 | ||
変換元リポジトリの走査中... | 変換元リポジトリの走査中... | ||
行 354: | 行 397: | ||
433 DataInterpreter big endian and unsigned swithces fixed. | 433 DataInterpreter big endian and unsigned swithces fixed. | ||
〜省略〜 | 〜省略〜 | ||
- | 2 Last touches for wxMSW. | + | 2 Last touches for wxMSW. |
- | 1 Fixed assertions due ~wxHexCtrl() cleanup code. | + | 1 Fixed assertions due ~wxHexCtrl() cleanup code. |
- | 0 Updated to v0.23 | + | 0 Updated to v0.23 |
ブックマークの更新中 | ブックマークの更新中 | ||
- | $ cd wxHexEditor-v0.23-src_hg | + | </ |
- | $ hg update | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | + | <font color="# | |
+ | </pre></ | ||
+ | </ | ||
===== トラブルシューティング ===== | ===== トラブルシューティング ===== | ||
行 369: | 行 413: | ||
hgrc の所有者やグループが自分ではない時に発生する。\\ | hgrc の所有者やグループが自分ではない時に発生する。\\ | ||
表示される所有者やグループが本当に信頼できるものであれば、~/ | 表示される所有者やグループが本当に信頼できるものであれば、~/ | ||
- | <code> | + | <WRAP color_term> |
- | $ vi ~/.hgrc | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | <file ini ~/.hgrc> | + | </pre></ |
+ | <WRAP color_mincode> | ||
[trusted] | [trusted] | ||
users = root | users = root | ||
groups = root | groups = root | ||
- | </ | + | </file></ |
+ | </WRAP> | ||
==== インストール時に「gcc: | ==== インストール時に「gcc: | ||
行 383: | 行 429: | ||
\\ | \\ | ||
redhat-rpm-config パッケージをインストールしてから行う。 | redhat-rpm-config パッケージをインストールしてから行う。 | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo dnf install redhat-rpm-config | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
===== 参考文献 ===== | ===== 参考文献 ===== |