#!/bin/sh # # Copyright (c) 2008 Deskin Miller # global test_description := ''git svn partial-rebuild tests'' source ./lib-git-svn.sh test_expect_success 'initialize svnrepo' ' mkdir import && ( (cd import && mkdir trunk branches tags && (cd trunk && echo foo > foo ) && svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null && svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \ -m "created branch a" ) && rm -rf import && svn_cmd co "$svnrepo"/trunk trunk && (cd trunk && echo bar >> foo && svn_cmd ci -m "updated trunk" ) && svn_cmd co "$svnrepo"/branches/a a && (cd a && echo baz >> a && svn_cmd add a && svn_cmd ci -m "updated a" ) && git svn init --stdlayout "$svnrepo" ) ' test_expect_success 'import an early SVN revision into git' ' git svn fetch -r1:2 ' test_expect_success 'make full git mirror of SVN' ' mkdir mirror && ( (cd mirror && git init && git svn init --stdlayout "$svnrepo" && git svn fetch ) ) ' test_expect_success 'fetch from git mirror and partial-rebuild' ' git config --add remote.origin.url "file://$PWD/mirror/.git" && git config --add remote.origin.fetch refs/remotes/*:refs/remotes/* && git fetch origin && git svn fetch ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git svn partial-rebuild tests">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./lib-git-svn.sh)}) (C {(test_expect_success)} {(SQ <"initialize svnrepo">)} { (SQ <"\n"> <"\tmkdir import &&\n"> <"\t(\n"> <"\t\t(cd import &&\n"> <"\t\tmkdir trunk branches tags &&\n"> <"\t\t(cd trunk &&\n"> <"\t\techo foo > foo\n"> <"\t\t) &&\n"> <"\t\tsvn_cmd import -m \"import for git-svn\" . \"$svnrepo\" >/dev/null &&\n"> <"\t\tsvn_cmd copy \"$svnrepo\"/trunk \"$svnrepo\"/branches/a \\\n"> <"\t\t\t-m \"created branch a\"\n"> <"\t\t) &&\n"> <"\t\trm -rf import &&\n"> <"\t\tsvn_cmd co \"$svnrepo\"/trunk trunk &&\n"> <"\t\t(cd trunk &&\n"> <"\t\techo bar >> foo &&\n"> <"\t\tsvn_cmd ci -m \"updated trunk\"\n"> <"\t\t) &&\n"> <"\t\tsvn_cmd co \"$svnrepo\"/branches/a a &&\n"> <"\t\t(cd a &&\n"> <"\t\techo baz >> a &&\n"> <"\t\tsvn_cmd add a &&\n"> <"\t\tsvn_cmd ci -m \"updated a\"\n"> <"\t\t) &&\n"> <"\t\tgit svn init --stdlayout \"$svnrepo\"\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"import an early SVN revision into git">)} {(SQ <"\n"> <"\tgit svn fetch -r1:2\n">)} ) (C {(test_expect_success)} {(SQ <"make full git mirror of SVN">)} { (SQ <"\n"> <"\tmkdir mirror &&\n"> <"\t(\n"> <"\t\t(cd mirror &&\n"> <"\t\tgit init &&\n"> <"\t\tgit svn init --stdlayout \"$svnrepo\" &&\n"> <"\t\tgit svn fetch\n"> <"\t\t)\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"fetch from git mirror and partial-rebuild">)} { (SQ <"\n"> <"\tgit config --add remote.origin.url \"file://$PWD/mirror/.git\" &&\n"> <"\tgit config --add remote.origin.fetch refs/remotes/*:refs/remotes/* &&\n"> <"\tgit fetch origin &&\n"> <"\tgit svn fetch\n"> ) } ) (C {(test_done)}) ] )