#!/bin/sh global test_description := ''git svn handling of root commits in merge ranges'' source ./lib-git-svn.sh global svn_ver := $[svn --version --quiet] matchstr $svn_ver { 0.* | 1.[0-4].* { global skip_all := ""skipping git-svn test - SVN too old ($svn_ver)"" test_done } } test_expect_success 'test handling of root commits in merge ranges' ' mkdir -p init/trunk init/branches init/tags && echo "r1" > init/trunk/file.txt && svn_cmd import -m "initial import" init "$svnrepo" && svn_cmd co "$svnrepo" tmp && ( cd tmp && echo "r2" > trunk/file.txt && svn_cmd commit -m "Modify file.txt on trunk" && svn_cmd cp trunk@1 branches/a && svn_cmd commit -m "Create branch a from trunk r1" && svn_cmd propset svn:mergeinfo /trunk:1-2 branches/a && svn_cmd commit -m "Fake merge of trunk r2 into branch a" && mkdir branches/b && echo "r5" > branches/b/file2.txt && svn_cmd add branches/b && svn_cmd commit -m "Create branch b from thin air" && echo "r6" > branches/b/file2.txt && svn_cmd commit -m "Modify file2.txt on branch b" && svn_cmd cp branches/b@5 branches/c && svn_cmd commit -m "Create branch c from branch b r5" && svn_cmd propset svn:mergeinfo /branches/b:5-6 branches/c && svn_cmd commit -m "Fake merge of branch b r6 into branch c" ) && git svn init -s "$svnrepo" && 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 handling of root commits in merge ranges">)} spids: [3] ) ] spids: [3] ) (C {(.)} {(./lib-git-svn.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:svn_ver) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(svn)} {(--version)} {(--quiet)})]) left_token: spids: [15 21] ) ) } spids: [13] ) ] spids: [13] ) (Case to_match: {($ VSub_Name "$svn_ver")} arms: [ (case_arm pat_list: [ {(0.) (Lit_Other "*")} {(1.) (Lit_Other "[") (0-4) (Lit_Other "]") (.) (Lit_Other "*")} ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: {(DQ ("skipping git-svn test - SVN too old (") ($ VSub_Name "$svn_ver") (")"))} spids: [44] ) ] spids: [44] ) (C {(test_done)}) ] spids: [30 41 55 -1] ) ] spids: [24 28 57] ) (C {(test_expect_success)} {(SQ <"test handling of root commits in merge ranges">)} { (SQ <"\n"> <"\tmkdir -p init/trunk init/branches init/tags &&\n"> <"\techo \"r1\" > init/trunk/file.txt &&\n"> <"\tsvn_cmd import -m \"initial import\" init \"$svnrepo\" &&\n"> <"\tsvn_cmd co \"$svnrepo\" tmp &&\n"> <"\t(\n"> <"\t\tcd tmp &&\n"> <"\t\techo \"r2\" > trunk/file.txt &&\n"> <"\t\tsvn_cmd commit -m \"Modify file.txt on trunk\" &&\n"> <"\t\tsvn_cmd cp trunk@1 branches/a &&\n"> <"\t\tsvn_cmd commit -m \"Create branch a from trunk r1\" &&\n"> <"\t\tsvn_cmd propset svn:mergeinfo /trunk:1-2 branches/a &&\n"> <"\t\tsvn_cmd commit -m \"Fake merge of trunk r2 into branch a\" &&\n"> <"\t\tmkdir branches/b &&\n"> <"\t\techo \"r5\" > branches/b/file2.txt &&\n"> <"\t\tsvn_cmd add branches/b &&\n"> <"\t\tsvn_cmd commit -m \"Create branch b from thin air\" &&\n"> <"\t\techo \"r6\" > branches/b/file2.txt &&\n"> <"\t\tsvn_cmd commit -m \"Modify file2.txt on branch b\" &&\n"> <"\t\tsvn_cmd cp branches/b@5 branches/c &&\n"> <"\t\tsvn_cmd commit -m \"Create branch c from branch b r5\" &&\n"> <"\t\tsvn_cmd propset svn:mergeinfo /branches/b:5-6 branches/c &&\n"> <"\t\tsvn_cmd commit -m \"Fake merge of branch b r6 into branch c\"\n"> <"\t) &&\n"> <"\tgit svn init -s \"$svnrepo\" &&\n"> <"\tgit svn fetch\n"> <"\t"> ) } ) (C {(test_done)}) ] )