#!/bin/sh # # Copyright (c) 2010 Steven Walter # global test_description := ''git svn mergeinfo propagation'' source ./lib-git-svn.sh test_expect_success 'initialize source svn repo' ' svn_cmd mkdir -m x "$svnrepo"/trunk && svn_cmd co "$svnrepo"/trunk "$SVN_TREE" && ( cd "$SVN_TREE" && touch foo && svn_cmd add foo && svn_cmd commit -m "initial commit" ) && rm -rf "$SVN_TREE" ' test_expect_success 'clone svn repo' ' git svn init "$svnrepo"/trunk && git svn fetch ' test_expect_success 'change svn:mergeinfo' ' touch bar && git add bar && git commit -m "bar" && git svn dcommit --mergeinfo="/branches/foo:1-10" ' test_expect_success 'verify svn:mergeinfo' ' mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) && test "$mergeinfo" = "/branches/foo:1-10" ' test_expect_success 'change svn:mergeinfo multiline' ' touch baz && git add baz && git commit -m "baz" && git svn dcommit --mergeinfo="/branches/bar:1-10 /branches/other:3-5,8,10-11" ' test_expect_success 'verify svn:mergeinfo multiline' ' mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) && test "$mergeinfo" = "/branches/bar:1-10 /branches/other:3-5,8,10-11" ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git svn mergeinfo propagation">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./lib-git-svn.sh)}) (C {(test_expect_success)} {(SQ <"initialize source svn repo">)} { (SQ <"\n"> <"\tsvn_cmd mkdir -m x \"$svnrepo\"/trunk &&\n"> <"\tsvn_cmd co \"$svnrepo\"/trunk \"$SVN_TREE\" &&\n"> <"\t(\n"> <"\t\tcd \"$SVN_TREE\" &&\n"> <"\t\ttouch foo &&\n"> <"\t\tsvn_cmd add foo &&\n"> <"\t\tsvn_cmd commit -m \"initial commit\"\n"> <"\t) &&\n"> <"\trm -rf \"$SVN_TREE\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"clone svn repo">)} {(SQ <"\n"> <"\tgit svn init \"$svnrepo\"/trunk &&\n"> <"\tgit svn fetch\n">)} ) (C {(test_expect_success)} {(SQ <"change svn:mergeinfo">)} { (SQ <"\n"> <"\ttouch bar &&\n"> <"\tgit add bar &&\n"> <"\tgit commit -m \"bar\" &&\n"> <"\tgit svn dcommit --mergeinfo=\"/branches/foo:1-10\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"verify svn:mergeinfo">)} { (SQ <"\n"> <"\tmergeinfo=$(svn_cmd propget svn:mergeinfo \"$svnrepo\"/trunk) &&\n"> <"\ttest \"$mergeinfo\" = \"/branches/foo:1-10\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"change svn:mergeinfo multiline">)} { (SQ <"\n"> <"\ttouch baz &&\n"> <"\tgit add baz &&\n"> <"\tgit commit -m \"baz\" &&\n"> <"\tgit svn dcommit --mergeinfo=\"/branches/bar:1-10 /branches/other:3-5,8,10-11\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"verify svn:mergeinfo multiline">)} { (SQ <"\n"> <"\tmergeinfo=$(svn_cmd propget svn:mergeinfo \"$svnrepo\"/trunk) &&\n"> <"\ttest \"$mergeinfo\" = \"/branches/bar:1-10\n"> <"/branches/other:3-5,8,10-11\"\n"> ) } ) (C {(test_done)}) ] )