差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
python:mercurial [2024/01/29 13:11] – [Mercurial - 分散型バージョン管理システム] ともやん | python:mercurial [2024/03/14 09:06] – [リモートリポジトリの複製] ともやん | ||
---|---|---|---|
行 10: | 行 10: | ||
[[python: | [[python: | ||
- | CentOS | + | Fedora |
- | <code> | + | <WRAP color_term> |
- | $ sudo yum install gcc python-devel | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
===== インストール ===== | ===== インストール ===== | ||
**pip** によるインストール。\\ | **pip** によるインストール。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo pip install mercurial | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | < | + | </ |
- | <code> | + | <WRAP color_result>< |
- | WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead. | + | |
Collecting mercurial | Collecting mercurial | ||
- | Downloading | + | Downloading |
- | |████████████████████████████████| 7.5MB 1.2MB/s | + | < |
+ | Installing build dependencies | ||
+ | Getting requirements to build wheel ... done | ||
+ | Preparing metadata | ||
+ | Building wheels for collected packages: mercurial | ||
+ | Building wheel for mercurial (pyproject.toml) ... done | ||
+ | Created wheel for mercurial: filename=mercurial-6.6.3-cp312-cp312-linux_x86_64.whl size=4743353 sha256=a592c0a7feb366d2f05ce876e9ca095602dee4e3944359c46678136601ca6cd3 | ||
+ | Stored in directory: | ||
+ | Successfully built mercurial | ||
Installing collected packages: mercurial | Installing collected packages: mercurial | ||
- | Running setup.py install for mercurial ... done | + | Successfully installed mercurial-6.6.3 |
- | Successfully installed mercurial-5.3.2 | + | </pre></ |
- | </code> | + | |
</ | </ | ||
行 35: | 行 43: | ||
<WRAP color_term> | <WRAP color_term> | ||
<WRAP color_command>< | <WRAP color_command>< | ||
- | $ sudo pip install mercurial | + | <font color="# |
</ | </ | ||
- | < | + | < |
Looking in indexes: https:// | Looking in indexes: https:// | ||
Collecting mercurial | Collecting mercurial | ||
- | Downloading https:// | + | Downloading https:// |
- | <b style="color:#87af5f;"> | + | <font color="#5FAF00"> |
Installing collected packages: mercurial | Installing collected packages: mercurial | ||
- | Successfully installed mercurial-6.2.1 | + | Successfully installed mercurial-6.6.3 |
- | <b style=" | + | |
- | WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available. | + | |
- | You should consider upgrading via the '/ | + | |
</ | </ | ||
<WRAP color_command>< | <WRAP color_command>< | ||
- | $ which hg | + | <font color="# |
</ | </ | ||
- | < | + | < |
- | /usr/ | + | /home/dietpi/.local/ |
- | </ | + | |
- | <WRAP color_command>< | + | |
- | $ hg version | + | |
- | </ | + | |
- | <WRAP color_resulr>< | + | |
- | Mercurial Distributed SCM (version 6.2.1) | + | |
- | (see https:// | + | |
- | + | ||
- | Copyright (C) 2005-2022 Olivia Mackall and others | + | |
- | This is free software; see the source for copying conditions. There is NO | + | |
- | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | |
</ | </ | ||
</ | </ | ||
**dnf** によるインストール。\\ | **dnf** によるインストール。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo dnf install | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | < | + | </ |
- | <code> | + | <WRAP color_result_long>< |
- | Last metadata expiration check: 0:14:18 ago on 2021年05月09日 03時46分00秒. | + | メタデータの期限切れの最終確認: 2:21:11 前の 2024年02月27日 03時39分09秒 に実施しました。 |
- | Dependencies resolved. | + | 依存関係が解決しました。 |
- | ==================================================================================================== | + | ============================================================================================================== |
- | Package | + | パッケージ |
- | ==================================================================================================== | + | ============================================================================================================== |
- | Installing: | + | インストール: |
- | | + | <font color="# |
- | Installing dependencies: | + | 依存関係のインストール: |
- | mercurial-lang | + | <font color="# |
- | Transaction Summary | + | トランザクションの概要 |
- | ==================================================================================================== | + | ============================================================================================================== |
- | Install | + | インストール |
- | Total download size: 5.0 M | + | ダウンロードサイズの合計: 6.5 M |
- | Installed size: 24 M | + | インストール後のサイズ: 31 M |
- | Is this ok [y/N]: y | + | パッケージのダウンロード: |
- | Downloading Packages: | + | (1/ |
- | (1/ | + | (2/2): mercurial-6.5.3-1.fc39.x86_64.rpm |
- | (2/2): mercurial-py3-5.4.2-3.fc33.x86_64.rpm | + | -------------------------------------------------------------------------------------------------------------- |
- | ---------------------------------------------------------------------------------------------------- | + | 合計 |
- | Total 261 kB/s | 5.0 MB 00:19 | + | トランザクションの確認を実行中 |
- | Running transaction check | + | トランザクションの確認に成功しました。 |
- | Transaction check succeeded. | + | トランザクションのテストを実行中 |
- | Running transaction test | + | トランザクションのテストに成功しました。 |
- | Transaction test succeeded. | + | トランザクションを実行中 |
- | Running transaction | + | |
- | | + | |
- | | + | |
- | | + | scriptletの実行中: mercurial-6.5.3-1.fc39.x86_64 |
- | | + | |
- | | + | |
- | | + | |
- | Installed: | + | インストール済み: |
- | mercurial-lang-5.4.2-3.fc33.x86_64 | + | mercurial-6.5.3-1.fc39.x86_64 |
- | Complete! | + | 完了しました! |
- | </code> | + | </pre></ |
</ | </ | ||
===== 動作確認 ===== | ===== 動作確認 ===== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg version | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
- | < | + | </pre></ |
- | <code> | + | <WRAP color_result>< |
- | Mercurial | + | Mercurial |
- | (see https:// | + | (詳細は |
- | Copyright (C) 2005-2020 Matt Mackall and others | + | Copyright (C) 2005-2023 Olivia |
This is free software; see the source for copying conditions. There is NO | This is free software; see the source for copying conditions. There is NO | ||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
- | </code> | + | </pre></ |
</ | </ | ||
行 132: | 行 125: | ||
==== 初期設定 ==== | ==== 初期設定 ==== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ hg config --edit | + | <font color="# |
- | </code> | + | </pre></ |
もしくは\\ | もしくは\\ | ||
- | <code> | + | <WRAP color_command>< |
- | $ vi ~/.hgrc | + | <font color="# |
- | </code> | + | </ |
+ | もしくは\\ | ||
+ | <WRAP color_command>< | ||
+ | <font color="# | ||
+ | </pre></ | ||
</ | </ | ||
- | < | + | ※**hg** コマンドのデフォルトエディタは **EDITOR** 変数が設定されていない限りは **vi** である。\\ |
- | <code ini ~/.hgrc> | + | 永続的に **nano** に変更する場合は、以下のように設定を保存する。\\ |
+ | |||
+ | **zsh**\\ | ||
+ | < | ||
+ | <WRAP color_command>< | ||
+ | <font color=" | ||
+ | <font color="# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | **Bash**\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <font color="# | ||
+ | <font color="# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Mercurial のユーザー名を設定する🤔\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_mincode> | ||
[ui] | [ui] | ||
username = Tomoyan < | username = Tomoyan < | ||
- | </ | + | </code></ |
</ | </ | ||
- | ※**hg** コマンドのデフォルトエディタは **EDITOR** 変数が設定されていない限りは **vi** である。\\ | ||
- | **nano** に変更する場合は以下のように実行する。\\ | ||
- | < | ||
- | $ EDITOR=nano hg config --edit | ||
- | </ | ||
- | もしくは、**.bashrc** に設定を保存する。\\ | ||
- | < | ||
- | $ echo ' | ||
- | $ . ~/.bashrc | ||
- | </ | ||
==== リポジトリの作成 ==== | ==== リポジトリの作成 ==== | ||
既存のディレクトリでリポジトリを作成する。 | 既存のディレクトリでリポジトリを作成する。 | ||
- | <code> | + | <WRAP color_term> |
- | $ mkdir repos | + | <WRAP color_command>< |
- | $ cd repos | + | <font color="# |
- | $ hg init | + | <font color="# |
- | </code> | + | </pre></ |
+ | </WRAP> | ||
新たにリポジトリのディレクトリを作成する。 | 新たにリポジトリのディレクトリを作成する。 | ||
- | <code> | + | <WRAP color_term> |
- | $ hg init repos | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== ソース管理から除外するファイルの設定 ==== | ==== ソース管理から除外するファイルの設定 ==== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ vi .hgignore | + | <font color="# |
- | </code> | + | </pre></ |
</ | </ | ||
- | < | + | < |
- | <code autoconf .hgignore> | + | <WRAP color_mincode> |
# Shell 形式パターンマッチ | # Shell 形式パターンマッチ | ||
syntax: glob | syntax: glob | ||
行 189: | 行 202: | ||
^\.git/ | ^\.git/ | ||
- | </ | + | </code></ |
</ | </ | ||
==== ファイルの追加 ==== | ==== ファイルの追加 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg add file.txt | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== ステータスの確認 ==== | ==== ステータスの確認 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ hg status | + | <WRAP color_command>< |
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
A file.txt | A file.txt | ||
- | </code> | + | </pre></ |
+ | </WRAP> | ||
==== コミット ==== | ==== コミット ==== | ||
行 229: | 行 248: | ||
==== リモートリポジトリの複製 ==== | ==== リモートリポジトリの複製 ==== | ||
- | ssh経由でリモートリポジトリをローカルに複製する。 | + | ssh 経由でリモートリポジトリをローカルに複製する。 |
- | <code> | + | <WRAP color_term> |
- | $ hg clone ssh:// | + | <WRAP color_command>< |
- | </code> | + | <font color="# |
+ | </pre></ | ||
+ | </WRAP> | ||
==== リモートリポジトリの変更取得 ==== | ==== リモートリポジトリの変更取得 ==== |