# # add_file "tests/t_gitimport2.at" # # patch "tests/t_gitimport2.at" # from [] # to [a30ca6ab36565693c194526761220ad9905c87a6] # # patch "testsuite.at" # from [77ff0030dd6014551ad04cc7efb7dfa7f1069d63] # to [8b8ea7065c172b65d4560f0a869b02f5b4ecc2ed] # ======================================================================== --- tests/t_gitimport2.at +++ tests/t_gitimport2.at a30ca6ab36565693c194526761220ad9905c87a6 @@ -0,0 +1,70 @@ +# -*- Autoconf -*- + +AT_SETUP([importing more interesting GIT archive]) + +MONOTONE_SETUP + +AT_DATA(importme.0, [version 0 of test file +]) + +AT_DATA(importme.1, [version 1 of test file +]) + +AT_DATA(importme.2, [version 2 of test file +]) + +AT_DATA(importme.3, [version 3 of test file +]) + +AT_DATA(taglist, [commit1 748f08f9c8d2588213205431273da20c1042f07e address@hidden +commit2 d049f5c92cab90d58306449aff93b6b6cf73c728 address@hidden +]) + +TSHA0=`SHA1(importme.0)` +TSHA1=`SHA1(importme.1)` +TSHA2=`SHA1(importme.2)` +TSHA3=`SHA1(importme.3)` + +# build the git repository + +AT_CHECK(git-init-db, [], [ignore], [ignore]) +AT_CHECK(test -e .git) +AT_CHECK(test -e .git/refs) +AT_CHECK(test -e .git/refs/heads) +AT_CHECK(test -e .git/refs/tags) + +# check out the working copy and make some commits + +AT_CHECK(cp importme.0 importme) +AT_CHECK(git-update-cache --add importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 0' | git-commit-tree $(git-write-tree) >.git/HEAD, [], [ignore], [ignore]) +AT_CHECK(cp importme.1 importme) +AT_CHECK(git-update-cache importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 1' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) >.git/HEAD, [], [ignore], [ignore]) +AT_CHECK(cat .git/HEAD >.git/refs/tags/commit1) +AT_CHECK(cp importme.2 importme) +AT_CHECK(git-update-cache importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 2' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) >.git/HEAD, [], [ignore], [ignore]) +AT_CHECK(cat .git/HEAD >.git/refs/tags/commit2) +AT_CHECK(cp importme.3 importme) +AT_CHECK(git-update-cache importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 3' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) >.git/HEAD, [], [ignore], [ignore]) + +# import into monotone and check presence of files + +AT_CHECK(MONOTONE --branch=testbranch git_import .git, [], [ignore], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA0, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA1, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA2, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA3, [], [ignore]) + +# also check that history is okay -- has a unique head, and it's the +# right one. + +AT_CHECK(MONOTONE list tags >taglist.t) +AT_CHECK(cmp taglist taglist.t) + +AT_CHECK(MONOTONE checkout --branch=testbranch mtcodir, [], [ignore], [ignore]) +AT_CHECK(cmp importme.3 mtcodir/importme) + +AT_CLEANUP ======================================================================== --- testsuite.at 77ff0030dd6014551ad04cc7efb7dfa7f1069d63 +++ testsuite.at 8b8ea7065c172b65d4560f0a869b02f5b4ecc2ed @@ -695,3 +695,4 @@ m4_include(tests/t_log_brief.at) m4_include(tests/t_explicit_merge_with_anc.at) m4_include(tests/t_gitimport.at) +m4_include(tests/t_gitimport2.at)