# HG changeset patch # User Brendan Cully # Date 2008-10-30 19:31:24 # Node ID 695383442347b4e888ef03e8c0a71086bd53c933 # Parent 66d0fc10804489401bed3f053e46bb8d063a2e81 mq: put qnew tests into own file, fold in qnew-twice diff --git a/tests/test-mq b/tests/test-mq --- a/tests/test-mq +++ b/tests/test-mq @@ -42,17 +42,6 @@ echo % qinit -c hg --cwd c qinit -c hg -R c/.hg/patches st -echo % qnew should refuse bad patch names -hg -R c qnew series -hg -R c qnew status -hg -R c qnew guards -hg -R c qnew .hgignore - -echo % qnew implies add - -hg -R c qnew test.patch -hg -R c/.hg/patches st - echo '% qinit; qinit -c' hg init d cd d @@ -90,25 +79,7 @@ cd .. cd a -echo a > somefile -hg add somefile - -echo % qnew with uncommitted changes - -hg qnew uncommitted.patch -hg st -hg qseries - -echo '% qnew missing' -hg qnew missing.patch missing - -hg revert --no-backup somefile -rm somefile - -echo % qnew -m - hg qnew -m 'foo bar' test.patch -cat .hg/patches/test.patch echo % qrefresh diff --git a/tests/test-mq-qnew-twice b/tests/test-mq-qnew rename from tests/test-mq-qnew-twice rename to tests/test-mq-qnew --- a/tests/test-mq-qnew-twice +++ b/tests/test-mq-qnew @@ -3,8 +3,41 @@ echo "[extensions]" >> $HGRCPATH echo "mq=" >> $HGRCPATH -hg init a -cd a +hg init mq +cd mq + +echo a > a +hg ci -Ama + +echo '% qnew should refuse bad patch names' +hg qnew series +hg qnew status +hg qnew guards +hg qnew .hgignore + +hg qinit -c + +echo '% qnew with uncommitted changes' +echo a > somefile +hg add somefile +hg qnew uncommitted.patch +hg st +hg qseries +hg revert --no-backup somefile +rm somefile + +echo '% qnew implies add' +hg qnew test.patch +hg -R .hg/patches st + +echo '% qnew missing' +hg qnew missing.patch missing + +echo '% qnew -m' +hg qnew -m 'foo bar' mtest.patch +cat .hg/patches/mtest.patch + +echo '% qnew twice' hg qnew first.patch hg qnew first.patch diff --git a/tests/test-mq-qnew-twice.out b/tests/test-mq-qnew.out rename from tests/test-mq-qnew-twice.out rename to tests/test-mq-qnew.out --- a/tests/test-mq-qnew-twice.out +++ b/tests/test-mq-qnew.out @@ -1,2 +1,20 @@ +adding a +% qnew should refuse bad patch names +abort: "series" cannot be used as the name of a patch +abort: "status" cannot be used as the name of a patch +abort: "guards" cannot be used as the name of a patch +abort: ".hgignore" cannot be used as the name of a patch +% qnew with uncommitted changes +abort: local changes found, refresh first +A somefile +% qnew implies add +A .hgignore +A series +A test.patch +% qnew missing +abort: missing: No such file or directory +% qnew -m +foo bar +% qnew twice abort: patch "first.patch" already exists abort: patch "first.patch" already exists diff --git a/tests/test-mq.out b/tests/test-mq.out --- a/tests/test-mq.out +++ b/tests/test-mq.out @@ -65,15 +65,6 @@ adding b/z % qinit -c A .hgignore A series -% qnew should refuse bad patch names -abort: "series" cannot be used as the name of a patch -abort: "status" cannot be used as the name of a patch -abort: "guards" cannot be used as the name of a patch -abort: ".hgignore" cannot be used as the name of a patch -% qnew implies add -A .hgignore -A series -A test.patch % qinit; qinit -c .hgignore: ^\.hg @@ -96,13 +87,6 @@ bleh series: A B -% qnew with uncommitted changes -abort: local changes found, refresh first -A somefile -% qnew missing -abort: missing: No such file or directory -% qnew -m -foo bar % qrefresh foo bar