ツール:mercurial

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ツール:mercurial [2019/02/13 19:13] – [リポジトリを修復したい] mumeiyamibitoツール:mercurial [2020/10/12 10:17] (現在) mumeiyamibito
行 12: 行 12:
  
 ===== インストール ===== ===== インストール =====
-  - インストール\\ <code bash>$ sudo apt-get install mercurial</code>+==== apt からのインストール ==== 
 +<code bash>$ sudo apt install mercurial</code> 
 + 
 +==== pip からのインストール ==== 
 +<code bash>$ sudo -H pip3 install mercurial</code> 
 + 
 +  * 最新版がインストールされる。 
 +  * ''libbz2-dev'' と ''libffi-dev'' が必要。 
 + 
 +==== 初期設定 ==== 
   - 設定   - 設定
     * ホームディレクトリに .hgrc を作成して編集する\\ <code>     * ホームディレクトリに .hgrc を作成して編集する\\ <code>
行 355: 行 365:
  
   * 詳しくは [[https://www.mercurial-scm.org/wiki/JapaneseUsingExtensions | JapaneseUsingExtensions - Mercurial]]   * 詳しくは [[https://www.mercurial-scm.org/wiki/JapaneseUsingExtensions | JapaneseUsingExtensions - Mercurial]]
 +
 +==== リポジトリを git リポジトリに変換する ====
 +  - 変換プログラムをダウンロードする。\\ <code bash>
 +$ git clone http://repo.or.cz/r/fast-export.git fast-export
 +</code>
 +  - 転送先の git リポジトリ (空) ''NEW_GIT_REPO'' を作成する。\\ <code bash>
 +$ mkdir NEW_GIT_REPO
 +$ cd NEW_GIT_REPO
 +$ git init 
 +</code>
 +  - 変換する。\\ <code bash>
 +$ ../fast-export/hg-fast-export.sh -r HG_REPO_PATH
 +</code>
 +    * ''HG_REPO_PATH'': 変換したい mercurial のリポジトリパス
 +  * 参考サイト: [[http://var.blog.jp/archives/81872068.html | mercurial リポジトリを git に移行する]]
 +
 +
 +===== Tips =====
 +==== 一部のサブコマンドで pager を無効化する ====
 +  * ''hg status'' や ''hg log'' などの結果はデフォルトでは、''less'' コマンド (pager) のように表示される。
 +  * これらの結果をプロンプトに反映させたい場合や、端末上にその結果を残したい (pager は q キーを押すと、結果が消える) 場合は、設定ファイル ''$HOME/.hgrc'' に以下を追記すると良い。\\ <code>
 +[pager]
 +ignore = SUBCOMMAND [, SUBCOMMND, ...]
 +</code>
 +    * ''SUBCOMMAND'': pager を無効化したいサブコマンド (''log'' や ''status'' など hg の後に付けるキーワード)
 +    * 複数ある場合は、カンマで区切る
 +    * 参考サイト: [[https://www.mercurial-scm.org/wiki/PagerExtension | PagerExtension - Mercurial]]
 +  * 一時的に無効化したい場合は、''--pager false'' を各コマンドの後ろにでも付けておけば良い。
 +    * 例:\\ <code>
 +$ hg log --pager false
 +</code>
 +  * 参考サイト: [[https://stackoverflow.com/questions/44894062/disable-color-and-paging-for-mercurial | Disable color and paging for mercurial - Stack Overflow]]
  
 ===== 参考サイト ===== ===== 参考サイト =====
  • ツール/mercurial.1550052789.txt.gz
  • 最終更新: 2019/02/13 19:13
  • by mumeiyamibito