LoginSignup
3
2

More than 5 years have passed since last update.

aptコマンドでインストールしたMercurial-git(hg-git)を有効化する

Posted at

自宅作業(という名の趣味)で2回も躓いたので書いておく。
「ドキュメントとログちゃんと見ろよ」という話なのだが。

aptのログを見よう

インストールし終わった最後の方に以下のメッセージが出る。

You can follow the instructions in /usr/share/doc/mercurial-git/README.Debian to enable it.

この通りなのである。
中身を見てみよう。

hg-git for Debian

To enable the extension, add the following lines to your hgrc::

[extensions]
hgext.bookmarks =
hgext.git =

Hg-git uses bookmarks [1]_ (rather than branches) to track git branches.

.. [1] http://mercurial.selenic.com/wiki/BookmarksExtension

つまりお手元のhgrcの[extensions]セクションにhgext.git =と入れるだけである。

どうしてハマるの?

公式ページを見てみよう。
Hg-Git Mercurial Plugin

Lastly, make sure the following is in your ~/.hgrc:

[extensions]
hgext.bookmarks =
hggit = 

easy_installで入れた場合にはhggitなのかもしれないが、今回はdebパッケージで配布されている物を使ったので、そりゃあパッケージの付属ドキュメント通りにしないとね。

余談

他にもつまづきそうなポイントはこちらが思いつく。
hg-git で github に push するときに忘れるな hg bookmark -f master - Qiita

ただし、複数人で作業しているときはmasterにいきなり上げたくは無いと思うので、その際はhg-gitを入れた後にgitのブランチの感覚でmaster以外のbookmarkをつけて、そのbookmarkを指定してpushすればいいのかな。(要調査)

# 予めhgrcの[path]セクションに「github」というアドレスを指定したと想定。

hg bookmark -r default fix_XYZ
hg push -B fix_XYZ github
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2