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しておけば良いってことかな。





