Commits

Takumi IINO committed 32fbdbb

add practices

Comments (0)

Files changed (6)

rewrite/folding-1.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+touch file1; hg add; hg commit -m "add file1"
+touch file2; hg add; hg commit -m "add file2"
+touch file3; hg add; hg commit -m "add file3"
+touch file4; hg add; hg commit -m "add file4"
+touch file5; hg add; hg commit -m "add file5"
+
+echo "課題" $(basename $0 .sh)
+echo "1.revision 1からrevison 5までをhg qfoldを使って"
+echo "1つのコミットにしてください。"
+echo ""
+echo "2.コミットログを「add file1, file2, file3, file4 and file5」"
+echo "に変更してください。"
+
+)

rewrite/folding-2.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+touch file1; hg add; hg commit -m "add file1"
+touch file2; hg add; hg commit -m "add file2"
+touch file3; hg add; hg commit -m "add file3"
+touch file4; hg add; hg commit -m "add file4"
+touch file5; hg add; hg commit -m "add file5"
+
+echo "課題" $(basename $0 .sh)
+echo "1.revision 1, revision 3, revison 5までをhg qfoldを使って"
+echo "1つのコミットにしてください。"
+echo ""
+echo "2.コミットログは「add odd files」"
+echo "に変更してください。"
+echo ""
+echo "3.revision 2, revision 4までをhg qfoldを使って"
+echo "1つのコミットにしてください。"
+echo ""
+echo "4.コミットログは「add even files」"
+echo "に変更してください。"
+
+)

rewrite/rebase-1.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+
+touch file1; hg add; hg commit -m "add file1"
+touch file2; hg add; hg commit -m "add file2"
+touch file3; hg add; hg commit -m "add file3"
+touch file4; hg add; hg commit -m "add file4"
+hg up 2
+touch file5; hg add; hg commit -m "add file5"
+
+echo "課題" $(basename $0 .sh)
+echo "mqのコマンドのみで履歴を一直線にしてください。"
+echo ""
+echo "ヒント:"
+echo "hg qimport -r REV"
+echo "hg qpop"
+
+)

rewrite/rebase-2.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+
+touch file1; hg add; hg commit -m "add file1"
+hg up 0
+touch file2; hg add; hg commit -m "add file2"
+hg up 0
+touch file3; hg add; hg commit -m "add file3"
+hg up 0
+touch file4; hg add; hg commit -m "add file4"
+hg up 0
+touch file5; hg add; hg commit -m "add file5"
+hg up 0
+
+echo "課題" $(basename $0 .sh)
+echo "mqのコマンドのみで履歴を一直線にしてください。"
+echo ""
+echo "ヒント:"
+echo "hg qimport -r REV"
+echo "hg qpop"
+
+)

rewrite/reorder-1.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+touch file5; hg add; hg commit -m "add file5"
+touch file3; hg add; hg commit -m "add file3"
+touch file2; hg add; hg commit -m "add file2"
+touch file4; hg add; hg commit -m "add file4"
+touch file1; hg add; hg commit -m "add file1"
+
+echo "課題" $(basename $0 .sh)
+echo "hg qpush --moveを利用せずにコミットをファイルの番号順に並び替えてください"
+
+)

rewrite/reorder-2.sh

+#!/bin/sh
+
+rm -rf $(basename $0 .sh)
+hg init $(basename $0 .sh)
+(
+cd $(basename $0 .sh)
+
+cat << EOT > .hg/hgrc
+[extensions]
+mq =
+EOT
+
+touch file0; hg add; hg commit -m "add file0"
+touch file5; hg add; hg commit -m "add file5"
+touch file3; hg add; hg commit -m "add file3"
+touch file2; hg add; hg commit -m "add file2"
+touch file4; hg add; hg commit -m "add file4"
+touch file1; hg add; hg commit -m "add file1"
+hg qimport -r 1:tip
+
+echo "課題" $(basename $0 .sh)
+echo "hg qpush --moveを利用してコミットをファイルの番号順に並び替えてください"
+echo ""
+echo "ヒント:"
+echo "hg qpop --all"
+echo "hg qpush --move"
+
+)