TortoiseHg から始める Mercurial (Ubuntu編)
TortoiseHg Advent Calendar 2012 - connpass の2日目のエントリになります。TortoiseHg ついて今回は、Linux編のインストールについてご紹介します。
Linux のディストリビューションはいくつかありますが、人気の高い Ubuntu を例にご紹介します*1
Ubuntu 12.04.01 LTS
せっかくなので、Ubuntu 12.10 の最新版 http://www.ubuntulinux.jp/ で試してみようと思いましたが、VirtualBox にインストールしたら、やけにもっさりしているので、12.04.01にします。LTSなので 2017年までサポートされますのでこれはこれで良いですね。
Ubuntu のパッケージは、TortoiseHg と Mercurial のパッケージが別々になっています。
インストール方法
普通に Ubuntu のパッケージになっているので、 apt-get でインストールできます。
$ sudo apt-get install tortoisehg
mercurial も一緒にインストールされます。
thg version にてバージョンが見れます
ユーザ設定
$ thg userconfig
にてユーザ設定画面が表示されます。
thg コマンド一覧
thg はGUIが起動しますが、コマンドを実行することもできます。help でコマンド一覧が表示されます。
tkondou@prism:~$ thg help Thg - TortoiseHg's GUI tools for Mercurial SCM (Hg) コマンド一覧: about about dialog add add files annotate annotate dialog archive archive dialog backout backout tool bisect bisect dialog clone clone tool commit commit tool drag_copy Copy the selected files to the desired directory drag_move Move the selected files to the desired directory email send changesets by email forget forget selected files grep grep/search dialog guess guess previous renames or copies help show help for a command, extension, or list of commands hgignore ignore filter editor import import an ordered set of patches init init dialog log workbench application manifest display the current or given revision of the project manifest merge merge wizard mq Mercurial Queue tool purge purge unknown and/or ignore files from repository qqueue manage multiple MQ patch queues qreorder Reorder unapplied MQ patches rebase rebase dialog rejects Manually resolve rejected patch chunks remove remove selected files rename rename dialog repoconfig repository configuration editor resolve resolve dialog revert revert selected files serve start stand-alone webserver shelve Move changes between working directory and patches status browse working copy status strip strip dialog sync Synchronize with other repositories tag tag tool test test arbitrary widgets update update/checkout tool userconfig user configuration editor vdiff launch configured visual diff tool version output version and copyright information use "thg -v help" to show aliases and global options tkondou@prism:~$
最新版のインストール方法
最新版は、ppaが別途用意されていますので、そちらから最新をインストールすることもでいます。tortoisehg の ppa を追加することで、mercurial もアップデートされます*2
$ sudo add-apt-repository ppa:tortoisehg-ppa/releases
$ sudo apt-get update
$ sudo apt-get install tortoisehg
これで、tortoisehg と mercurial が最新に更新されました。
Ubuntu の場合、パッケージの更新があると、通知がきますので、指示にしたがってアップデートすればよいでしょう。
さいごに
Ubuntu でも thg (TortoiseHg) を使うことができます。Linuxの場合は基本はコマンドラインだと思いますが、リビジョングラフを thg で見ながら作業すると捗ると思います。
明日は、Mac OS Xへのインストールについて @akiko_pusu さんが紹介してくれる予定です。楽しみですね。よろしくお願いします。
参考
*1:http://distrowatch.com/index.php?dataspan=13 ここ見ると3位ですね。Linux Mint が一番人気のようです