X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Ftests%2Finarchivecopy;h=e87baaf3252f75c486a678d7127c20fd38f41ccb;hp=c3c06b89220cdfca5d85769202019fa793474b49;hb=6ce82b29dc651abd46de2cc36c07f41f02c159ed;hpb=a889137c1c69f2731db20b61b22b42544de27e13 diff --git a/tests/tests/inarchivecopy b/tests/tests/inarchivecopy index c3c06b89..e87baaf3 100755 --- a/tests/tests/inarchivecopy +++ b/tests/tests/inarchivecopy @@ -2,16 +2,60 @@ set -e . tests/lib -t-restrict x-dgit-unfinished - t-setup-import examplegit +t-tstunt-parsechangelog -cat aq/package.sid.$p >>aq/package.stable.example +cd $p +git checkout -b dgit/stable dgit/dgit/stable +cd .. -t-archive-updated stable $p +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-archive-updated stable $p +} -cd $p +copy-check-good () { + git diff $vtag + t-refs-same refs/remotes/dgit/dgit/stable + t-ref-head +} + +copy-check () { + local vm=$1 + t-inarchive-copy $vm + + vtag=$(v=$vm t-v-tag) + + cd $p + t-refs-same-start + t-ref-same $vtag^1 + + t-dgit fetch stable + git merge --ff-only dgit/dgit/stable + + copy-check-good + local fetched=$(t-sametree-parent HEAD) + cd .. + + rm -rf example.cloned + t-dgit clone $p stable example.cloned + + cd example.cloned + t-refs-same-start + copy-check-good + local cloned=$(t-sametree-parent HEAD) + cd .. + + t-refs-same-start + t-ref-same-val fetched $fetched + t-ref-same-val cloned $cloned +} + +copy-check 2.0 -t-dgit fetch stable +copy-check 2.1 -xxx rest of test +echo ok.