マーキュリアルで手付かずのチェックアウトを行うにはどうすればよいですか? Martin Geisler は、以下を使用して、既に Mercurial でコミットされたファイルを削除する方法について説明しています。
hg strip "outgoing()"
しかし、" " に入った追加ファイルを保持したい場合はどうすればよいでしょうかoutgoing()
- 例:
2 人のユーザー a と b — 同じチェンジセットで開始
ユーザー a:
echo "A" > A.txt; hg ci -M -m ""; hg push
ユーザー b ( を実行するのを忘れたhg pull -u
):
echo "B" > B.txt; hg ci -M -m "" B.txt;
echo "C" > C.txt; hg ci -M -m "" C.txt;
ユーザー b が実行さhg strip "outgoing()"
れると、B.txt と C.txt が失われます。hg rollback
2 つのコミットがあるため、オプションではありません。
ユーザー b を自分のファイルを「ローカルに追加 - 追跡なし」に戻してhg pull -u
から、A.txt を取得し、後で B.txt と C.txt の追加/コミット/プッシュを処理できますか?
マーティン・ガイスラーは、前述のスレッドで以前にこれに答えました(私が削除してここに移動したコメント:
hg update "p1(min(outgoing()))"
hg revert --all --rev tip
hg strip "outgoing()"
hg pull -u
これで、ユーザー c は新しいファイル B.txt と C.txt で自分の作業を完了し、それらを commit+push できます。
これを行う他の方法は?