<< もうちょっと、奥で寝てくれんものかね。 | Home | Ubuntuで、emobileを使う時のおまじない。 >>
PR: 転職    お墓    エコ    通販    結婚相談所    シルバー    質屋    葬式    漫画    エステサロン   

Mercurialのdefault

Mercurialで、defaultって空気みたいな存在なので、いつもあるものだと思っていた。

$ hg init
$ ls >1
$ hg add 1
$ hg commit -m "1"
$ hg branches
default                        0:d83c9258dcc4

$ hg branch foo
作業領域をブランチ foo に設定
$ ls >2
$ hg add 2
$ hg commit -m "2"
$ ls
1  2
$ hg branches
foo                            1:f77fd9d2ea1f
default                        0:d83c9258dcc4 (inactive)

$ hg update default
ファイル状態: 更新数 0、マージ数 0、削除数 1、衝突未解決数 0
$ ls
1

ところが、以下のような場合には、defaultが存在しないレポジトリとなることが分かった。

$ hg init
$ hg branch foo
作業領域をブランチ foo に設定
$ ls >1
$ hg add 1
$ hg commit -m "1"
$ hg branches
foo                            0:91a9035fc087

$ hg update default
中止: 'default' は未知のリビジョンです!

逆に言えば、defaultに相当するブランチの名前を変えたければ、hg init直後にhg branchしておけば良いってことかな。




コメント追加 トラックバック送信
このサイトの掲載内容は私自身の見解であり、必ずしもIBMの立場、戦略、意見を代表するものではありません。
日本アイ・ビー・エム 花井 志生 Since 1997.6.8