chiark / gitweb /
Test suite: inarchivecopy: Is finished
[dgit.git] / tests / tests / inarchivecopy
index 8f44ea69824d5ab78076e686dc7a1861a80ddf67..41c0321e3c0205820e72050be5125fa04f969735 100755 (executable)
@@ -2,22 +2,59 @@
 set -e
 . tests/lib
 
-t-restrict x-dgit-unfinished
-
 t-setup-import examplegit
 
 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-archive-updated stable $p
+}
 
-t-archive-updated stable $p
+copy-check-good () {
+       git diff $vtag
+       t-refs-same refs/remotes/dgit/dgit/stable
+       t-ref-head
+}
 
-t-dgit clone $p stable foo
+copy-check () {
+       local vm=$1
+       t-inarchive-copy $vm
 
-cd $p
+       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.