{"thread":{"id":"9418","subject":"[StGIT PATCH 0/2] New and improved tests","startedAt":"2007-08-07T02:43:45Z","lastAt":"2007-08-07T02:43:56Z","messageCount":3,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"50073","messageId":"20070807024147.11174.87229.stgit@yoghurt","threadId":"9418","inReplyTo":null,"subject":"[StGIT PATCH 0/2] New and improved tests","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-07T02:43:45Z","receivedAt":"2007-08-07T02:43:45Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"One new and one improved test, both primarily useful for making sure\nthe DAG pseries doesn't break anything, since no one else has managed\nto produce bugs that mess up the patch order.\n\nThis far. So they might be worth having anyway. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"50074","messageId":"20070807024351.11174.22203.stgit@yoghurt","threadId":"9418","inReplyTo":"20070807024147.11174.87229.stgit@yoghurt","subject":"[StGIT PATCH 1/2] New test: make sure that popping doesn't change patch order","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-07T02:43:51Z","receivedAt":"2007-08-07T02:43:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This is mostly useful in conjunction with the DAG appliedness patches,\nsince getting this right with a plain series file _ought_ to be\ntrivial. Nevertheless ...\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n t/t1203-pop.sh |   33 +++++++++++++++++++++++++++++++++\n 1 files changed, 33 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1203-pop.sh b/t/t1203-pop.sh\nnew file mode 100755\nindex 0000000..0a311d4\n--- /dev/null\n+++ b/t/t1203-pop.sh\n@@ -0,0 +1,33 @@\n+#!/bin/sh\n+# Copyright (c) 2007 Karl Hasselström\n+test_description='Test the pop command'\n+. ./test-lib.sh\n+\n+test_expect_success \\\n+    'Initialize the StGIT repository' \\\n+    'stg init'\n+\n+test_expect_success \\\n+    'Create ten patches' '\n+    for i in 0 1 2 3 4 5 6 7 8 9; do\n+        stg new p$i -m p$i;\n+    done &&\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2 p3 p4 p5 p6 p7 p8 p9\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ]\n+'\n+\n+test_expect_success \\\n+    'Pop half the patches' '\n+    stg pop -n 5 &&\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2 p3 p4\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p6 p7 p8 p9\" ]\n+'\n+\n+test_expect_success \\\n+    'Pop the remaining patches' '\n+    stg pop -a &&\n+    [ \"$(echo $(stg applied))\" = \"\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p0 p1 p2 p3 p4 p5 p6 p7 p8 p9\" ]\n+'\n+\n+test_done\n"},{"id":"50075","messageId":"20070807024356.11174.47706.stgit@yoghurt","threadId":"9418","inReplyTo":"20070807024147.11174.87229.stgit@yoghurt","subject":"[StGIT PATCH 2/2] Verify patch status during the test","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-07T02:43:56Z","receivedAt":"2007-08-07T02:43:56Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Signed-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n t/t1200-push-modified.sh |   55 +++++++++++++++++++++++++++-------------------\n 1 files changed, 32 insertions(+), 23 deletions(-)\n\ndiff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh\nindex 324b3b0..0e408d0 100755\n--- a/t/t1200-push-modified.sh\n+++ b/t/t1200-push-modified.sh\n@@ -19,23 +19,26 @@ specify --merged, then rollback and retry with the correct flag.'\n test_create_repo foo\n \n test_expect_success \\\n-    'Clone tree and setup changes' \\\n-    \"stg clone foo bar &&\n-     (cd bar && stg new p1 -m p1 &&\n-      printf 'a\\nc\\n' > file && stg add file && stg refresh &&\n-      stg new p2 -m p2 &&\n-      printf 'a\\nb\\nc\\n' > file && stg refresh\n-     )\n-\"\n+    'Clone tree and setup changes' '\n+    stg clone foo bar &&\n+    (\n+        cd bar && stg new p1 -m p1 &&\n+        printf \"a\\nc\\n\" > file && stg add file && stg refresh &&\n+        stg new p2 -m p2 &&\n+        printf \"a\\nb\\nc\\n\" > file && stg refresh &&\n+        [ \"$(echo $(stg applied))\" = \"p1 p2\" ] &&\n+        [ \"$(echo $(stg unapplied))\" = \"\" ]\n+    )\n+'\n \n test_expect_success \\\n-    'Port those patches to orig tree' \\\n-    '(cd foo &&\n-      GIT_DIR=../bar/.git git-format-patch --stdout \\\n-          $(cd ../bar && stg id base@master)..HEAD |\n-      git-am -3 -k\n-     )\n-    '\n+    'Port those patches to orig tree' '\n+    (\n+        cd foo &&\n+        GIT_DIR=../bar/.git git-format-patch --stdout \\\n+          $(cd ../bar && stg id base@master)..HEAD | git-am -3 -k\n+    )\n+'\n \n test_expect_success \\\n     'Pull to sync with parent, preparing for the problem' \\\n@@ -51,15 +54,21 @@ test_expect_failure \\\n \"\n \n test_expect_success \\\n-    'Rollback the push' \\\n-    \"(cd bar && stg push --undo\n-     )\n-\"\n+    'Rollback the push' '\n+    (\n+        cd bar && stg push --undo &&\n+        [ \"$(echo $(stg applied))\" = \"\" ] &&\n+        [ \"$(echo $(stg unapplied))\" = \"p1 p2\" ]\n+    )\n+'\n \n test_expect_success \\\n-    'Push those patches while checking they were merged upstream' \\\n-    \"(cd bar && stg push --merged --all\n-     )\n-\"\n+    'Push those patches while checking they were merged upstream' '\n+    (\n+        cd bar && stg push --merged --all\n+        [ \"$(echo $(stg applied))\" = \"p1 p2\" ] &&\n+        [ \"$(echo $(stg unapplied))\" = \"\" ]\n+    )\n+'\n \n test_done\n"}]}