X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fgdr-subcommands;h=4197ab011808615da731f767b49d08ba0153fcd6;hb=ff26ffe86083d2759ae4f6d839d69ff4da5182d7;hp=e59fc07aaeab6ada1e0a510e3be9ff8b3027d299;hpb=4eee70a2b1710c1a8fc71fbd3cdc7064682a799c;p=dgit.git diff --git a/tests/tests/gdr-subcommands b/tests/tests/gdr-subcommands index e59fc07a..4197ab01 100755 --- a/tests/tests/gdr-subcommands +++ b/tests/tests/gdr-subcommands @@ -4,6 +4,7 @@ set -e t-dependencies GDR +t-tstunt-parsechangelog t-setup-import gdr-convert-gbp cd $p @@ -24,6 +25,11 @@ mix-it () { t-git-next-date } +git checkout -b raw-converted-from-gbp converted-from-gbp +test "$(git diff --stat HEAD^2)" +git diff --exit-code --stat HEAD^1 +git reset --hard HEAD^1 + git checkout -b stitched-laundered master mix-it t-git-debrebase quick @@ -34,10 +40,12 @@ mix-it git checkout -b unstitched-laundered master mix-it +git branch before-unstitch/unstitched-laundered t-git-debrebase t-gdr-good laundered git checkout -b unstitched-mixed master +git branch before-unstitch/unstitched-mixed t-git-debrebase mix-it @@ -48,7 +56,8 @@ git show-ref subcmd () { local subcmd=$1 shift - for startbranch in {stitched,unstitched}-{laundered,mixed}; do + for startbranch in {stitched,unstitched}-{laundered,mixed} \ + raw-converted-from-gbp; do work="work-$subcmd-$startbranch" : "---------- $subcmd $startbranch ----------" @@ -124,7 +133,7 @@ make_check () { case "$1" in [Nn]*) t-refs-same-start - t-refs-same refs/heads/$before refs/heads/$work + t-refs-same refs/heads/$before refs/heads/$peel ;; U*) t-refs-same-start @@ -166,12 +175,23 @@ make_check () { git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches' t-gdr-good laundered ;; + A*) + t-refs-notexist \ + refs/ffq-prev/heads/$work \ + refs/debrebase-last/heads/$work + ;; t*) git diff --quiet HEAD refs/heads/$before ;; f*) t-has-ancestor HEAD refs/heads/$before ;; + Z*) + t-refs-same-start + t-refs-same refs/heads/$peel + t-refs-same refs/heads/before-unstitch/$startbranch + t-ref-head + ;; *) fail "$1" ;; @@ -182,20 +202,21 @@ Ec="F:No ongoing git-debrebase session" Ep="F:Patch export produced patch amendments" # input state: -# stitched? st'd st'd unst'd unst'd -# laundered? laund'd mixed laund'd mixed +# stitched? st'd st'd unst'd unst'd convert +# laundered? laund'd mixed laund'd mixed -from-gbp # # "mixed" means an out of order branch # containing mixed commits and patch additions, # but which needs even more patches # -subcmd '' Ult Ull Vlt Vl -subcmd stitch Ns Nu Sltf Stf -subcmd prepush Ns Nu Sltf Stf -subcmd quick ns Sl Sltf Sl -subcmd conclude "$Ec" "$Ec" Sltf Sl -subcmd make-patches sPft "$Ep" uPft "$Ep" -#subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep" +subcmd '' Ult Ull Vlt Vl nU +subcmd stitch Ns Nu Sltf Stf Ns +subcmd prepush ns nu Sltf Stf ns +subcmd quick ns Sl Sltf Sl n +subcmd conclude "$Ec" "$Ec" Sltf Sl N +subcmd scrap Ns Ns Z Z N +subcmd make-patches sPft "$Ep" uPft "$Ep" Pn +subcmd forget-was-ever-debrebase nA nA nA nA nA # # result codes, each one is a check: # E:$pat } this is an error (must come first) @@ -214,6 +235,8 @@ subcmd make-patches sPft "$Ep" uPft "$Ep" # V ffq-prev remains unchanged; implies also u # s result is stitched, debrebase-last exists and is unchanged # S result is stitch just made, remaining letters apply to result~ +# Z result is rewind to before changes made +# A no ffq-prev or debrebase-last refs ("Amnesia") # # P result is add-patches, remaining letters apply to result~ #