From: Eddy Petrisor <eddy@xxxxxxxxxxxxxxxx> --- t/t9130-git-svn-externals-fetch.sh | 76 ++++++++++++++++++++++++++++++++++++ t/t9130/clean.dump | 74 +++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 0 deletions(-) create mode 100755 t/t9130-git-svn-externals-fetch.sh create mode 100644 t/t9130/clean.dump diff --git a/t/t9130-git-svn-externals-fetch.sh b/t/t9130-git-svn-externals-fetch.sh new file mode 100755 index 0000000..70335ad --- /dev/null +++ b/t/t9130-git-svn-externals-fetch.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Copyright (c) 2008 Eddy PetriÈ?or + + +test_description='git svn properties pulls and updates externals' +. ./lib-git-svn.sh + +test_expect_success 'load repository with base directory' ' + svnadmin load -q "$rawsvnrepo" < ../t9130/clean.dump + ' + +test_expect_success 'checkout the simple repo' ' + mkdir -p gitrepo && + ( + cd gitrepo && + git svn init "$svnrepo/trunk" && + git svn fetch && + cd .. + ) + ' + +test_expect_success 'add an external in the repo' ' + svn checkout "$svnrepo/trunk" work.svn && + ( + cd work.svn && + svn propset svn:externals "external $(echo $svnrepo|sed "s#\ #%20#")/external" . && + svn commit -m "added external directory to repo" && + svn update && + cd .. && + rm -fr work.svn + ) + ' + +test_expect_success 'git svn fetch the property changes and fetch externals' ' + cd gitrepo && + git svn rebase && + git svn show-externals | grep -q "^/external" && + git svn-externals && + cd .. + ' + +test_expect_success 'create an external pinned to a version' ' + svn checkout "$svnrepo/trunk" work.svn && + ( + cd work.svn && + svn propset svn:externals "external -r2 $(echo $svnrepo|sed "s#\ #%20#")/external" . && + svn commit -m "pin the external to -r2" && + svn update && + cd .. && + rm -fr work.svn + ) && + svn checkout "$svnrepo/external" ext.svn && + ( + cd ext.svn && + echo "0" > externalfile && + svn commit -m "mark the bad floating revision for the external" && + cd .. && + rm -fr ext.svn + ) + ' + +test_expect_failure 'refresh revisioned externals in git' ' + cd gitrepo && + git config --list >> /tmp/test && + git svn rebase && + git svn-externals && + grep 1 external/externalfile && + cd .. + ' + +#TODO: add test_expect_success for a URI change for the external + + + +test_done diff --git a/t/t9130/clean.dump b/t/t9130/clean.dump new file mode 100644 index 0000000..9e26b66 --- /dev/null +++ b/t/t9130/clean.dump @@ -0,0 +1,74 @@ +SVN-fs-dump-format-version: 2 + +UUID: 13066bdd-4590-4b1e-8a3f-4379dfa77d1b + +Revision-number: 0 +Prop-content-length: 56 +Content-length: 56 + +K 8 +svn:date +V 27 +2008-07-10T11:26:12.351202Z +PROPS-END + +Revision-number: 1 +Prop-content-length: 125 +Content-length: 125 + +K 7 +svn:log +V 26 +bare structure of the repo +K 10 +svn:author +V 4 +eddy +K 8 +svn:date +V 27 +2008-07-10T11:31:04.711302Z +PROPS-END + +Node-path: external +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: external/externalfile +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 2 +Text-content-md5: b026324c6904b2a9cb4b88d6d61c81d1 +Content-length: 12 + +PROPS-END +1 + + +Node-path: trunk +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: trunk/dummyfile +Node-kind: file +Node-action: add +Prop-content-length: 10 +Text-content-length: 1 +Text-content-md5: 68b329da9893e34099c7d8ad5cb9c940 +Content-length: 11 + +PROPS-END + + + -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html