#!/bin/sh # # Copyright (c) 2009 Eric Wong global test_description := ''git svn old rev_map preservd'' source ./lib-git-svn.sh test_expect_success 'setup test repository with old layout' ' mkdir i && (cd i && > a) && svn_cmd import -m- i "$svnrepo" && git svn init "$svnrepo" && git svn fetch && test -d .git/svn/refs/remotes/git-svn/ && ! test -e .git/svn/git-svn/ && mv .git/svn/refs/remotes/git-svn .git/svn/ && rm -r .git/svn/refs ' test_expect_success 'old layout continues to work' ' svn_cmd import -m- i "$svnrepo/b" && git svn rebase && echo a >> b/a && git add b/a && git commit -m- -a && git svn dcommit && ! test -d .git/svn/refs/ && test -e .git/svn/git-svn/ ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git svn old rev_map preservd">)} spids: [10] ) ] spids: [10] ) (C {(.)} {(./lib-git-svn.sh)}) (C {(test_expect_success)} {(SQ <"setup test repository with old layout">)} { (SQ <"\n"> <"\tmkdir i &&\n"> <"\t(cd i && > a) &&\n"> <"\tsvn_cmd import -m- i \"$svnrepo\" &&\n"> <"\tgit svn init \"$svnrepo\" &&\n"> <"\tgit svn fetch &&\n"> <"\ttest -d .git/svn/refs/remotes/git-svn/ &&\n"> <"\t! test -e .git/svn/git-svn/ &&\n"> <"\tmv .git/svn/refs/remotes/git-svn .git/svn/ &&\n"> <"\trm -r .git/svn/refs\n"> ) } ) (C {(test_expect_success)} {(SQ <"old layout continues to work">)} { (SQ <"\n"> <"\tsvn_cmd import -m- i \"$svnrepo/b\" &&\n"> <"\tgit svn rebase &&\n"> <"\techo a >> b/a &&\n"> <"\tgit add b/a &&\n"> <"\tgit commit -m- -a &&\n"> <"\tgit svn dcommit &&\n"> <"\t! test -d .git/svn/refs/ &&\n"> <"\ttest -e .git/svn/git-svn/\n"> ) } ) (C {(test_done)}) ] )