X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Finarchivecopy;h=3f848815d551d4fea97947e371356def45fb6663;hb=50b6d1fa7bd440dcc7ef9d1803aa8e71e388361f;hp=8f44ea69824d5ab78076e686dc7a1861a80ddf67;hpb=b5e0be4384a3d44e75792e66b22bbb4c0a86d891;p=dgit.git diff --git a/tests/tests/inarchivecopy b/tests/tests/inarchivecopy index 8f44ea69..3f848815 100755 --- a/tests/tests/inarchivecopy +++ b/tests/tests/inarchivecopy @@ -2,22 +2,78 @@ set -e . tests/lib -t-restrict x-dgit-unfinished - t-setup-import examplegit +t-tstunt-parsechangelog cd $p -git show-ref >../t +git checkout -b dgit/stable dgit/dgit/stable cd .. -egrep '^1\.3' aq/package.sid.$p >>aq/package.stable.example +t-inarchive-copy () { + local vm=$1 + local from=${2:-sid} + local to=${3:-stable} + egrep "^${vm//./\\.}" aq/package.$from.$p >>aq/package.$to.$p + t-aq-archive-updated $to $p +} + +copy-check-good () { + git diff $vtag + t-refs-same refs/remotes/dgit/dgit/$tosuite + t-ref-head + t-has-parent-or-is HEAD $vtag +} + +copy-check () { + local vm=$1 + local tosuite=${2:-stable} + t-inarchive-copy $vm '' $tosuite + + vtag=$(v=$vm t-v-tag) + + cd $p + t-refs-same-start + t-dgit fetch $tosuite + git merge --ff-only dgit/dgit/$tosuite + + copy-check-good + local fetched; fetched=$(t-sametree-parent HEAD) + cd .. -t-archive-updated stable $p + rm -rf example.cloned + t-dgit clone $p $tosuite example.cloned -t-dgit clone $p stable foo + cd example.cloned + t-refs-same-start + copy-check-good + local cloned; cloned=$(t-sametree-parent HEAD) + cd .. + + rm -rf example.initd + mkdir example.initd + cd example.initd + git init + t-refs-same-start + t-dgit -p $p fetch $tosuite + git reset --hard refs/remotes/dgit/dgit/$tosuite + copy-check-good + local initd; initd=$(t-sametree-parent HEAD) + cd .. + + t-refs-same-start + t-ref-same-val fetched $fetched + t-ref-same-val cloned $cloned + t-ref-same-val initd $initd +} + +copy-check 2.0 + +copy-check 2.1 cd $p +git checkout -b dgit/testing $(v=1.1 t-v-tag) +cd .. -t-dgit fetch stable +copy-check 2.1 testing -xxx rest of test +t-ok