(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: { (SQ <'git-cvsserver and git refspecs\n'> <'\n'> <'tests ability for git-cvsserver to switch between and compare\n'> <'tags, branches and other git refspecs'> ) } spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: check_start_tree body: (command.BraceGroup children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))}) (command.SimpleCommand words: [{(echo)} {(DQ ('start ') ($ VSub_Number '$1'))}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ (${ VSub_Name WORKDIR) (/check.log))} ) ] ) ] spids: [34] ) spids: [30 33] ) (command.FuncDef name: check_file body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sandbox spids:[72]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [72] ) ] spids: [72] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:file spids:[78]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [78] ) ] spids: [78] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ver spids:[84]) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} spids: [84] ) ] spids: [84] ) (command.SimpleCommand words: [{(git)} {(show)} {(DQ (${ VSub_Name ver) (':') (${ VSub_Name file))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.got))} ) (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.stderr))} ) ] more_env: [(env_pair name:GIT_DIR val:{($ VSub_Name '$SERVERDIR')} spids:[90])] ) (C {(test_cmp)} {(DQ ($ VSub_Name '$WORKDIR') (/check.got))} {(DQ ($ VSub_Name '$sandbox') (/) ($ VSub_Name '$file'))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stat spids:[136]) op: Equal rhs: {($ VSub_QMark '$?')} spids: [136] ) ] spids: [136] ) (command.SimpleCommand words: [ {(echo)} { (DQ ('check_file ') ($ VSub_Name '$sandbox') (' ') ($ VSub_Name '$file') (' ') ($ VSub_Name '$ver') (' : ') ($ VSub_Name '$stat') ) } ] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.log))} ) ] ) (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$file'))}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))} ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {($ VSub_Name '$stat')} ) ] spids: [69] ) spids: [65 68] ) (command.FuncDef name: check_end_tree body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sandbox spids:[187]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [187] ) ] spids: [187] ) (command.SimpleCommand words: [ {(find)} {(DQ ($ VSub_Name '$sandbox'))} {(-name)} {(CVS)} {(-prune)} {(-o)} {(-type)} {(f)} {(-print)} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.actual))} ) ] ) (command.SimpleCommand words: [{(sort)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expected)} ) ] ) (command.Pipeline children: [ (command.SimpleCommand words: [{(sort)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.actual))} ) ] ) (command.SimpleCommand words: [{(sed)} {(-e)} {(DQ ('s%cvswork/%%'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual)})] ) ] negated: F ) (C {(test_cmp)} {(expected)} {(actual)}) (C {(rm)} {(expected)} {(actual)}) ] ) ] spids: [184] ) spids: [180 183] ) (command.FuncDef name: check_end_full_tree body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sandbox spids:[287]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [287] ) ] spids: [287] ) (command.SimpleCommand words: [{(sort)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expected)} ) ] ) (command.Pipeline children: [ (C {(find)} {(DQ ($ VSub_Name '$sandbox'))} {(-name)} {(CVS)} {(-prune)} {(-o)} {(-type)} {(f)} {(-print)} ) (C {(sed)} {(-e)} {(DQ ('s%') ($ VSub_Name '$sandbox') ('/%%'))}) (command.SimpleCommand words: [{(sort)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(act1)})] ) ] negated: F ) (C {(test_cmp)} {(expected)} {(act1)}) (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(--name-only)} {(-r)} {(DQ ($ VSub_Number '$2'))}) (command.SimpleCommand words: [{(sort)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(act2)})] ) ] negated: F ) (C {(test_cmp)} {(expected)} {(act2)}) (C {(rm)} {(expected)} {(act1)} {(act2)}) ] ) ] spids: [284] ) spids: [280 283] ) (command.FuncDef name: check_diff body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:diffFile spids:[414]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [414] ) ] spids: [414] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:vOld spids:[420]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [420] ) ] spids: [420] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:vNew spids:[426]) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} spids: [426] ) ] spids: [426] ) (C {(rm)} {(-rf)} {(diffSandbox)}) (command.AndOr ops: [Op_DAmp] children: [ (C {(git)} {(clone)} {(-q)} {(-n)} {(.)} {(diffSandbox)}) (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {(diffSandbox)}) (C {(git)} {(checkout)} {(DQ ($ VSub_Name '$vOld'))}) (command.SimpleCommand words: [{(git)} {(apply)} {(-p0)} {(--index)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ (../) ($ VSub_Name '$diffFile'))} ) ] ) (C {(git)} {(diff)} {(--exit-code)} {(DQ ($ VSub_Name '$vNew'))}) ] ) redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(check_diff_apply.out)} ) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] spids: [454 503] ) ] ) ] spids: [411] ) spids: [407 410] ) (command.SimpleCommand words: [{(cvs)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_QMark '$?')} {(-ne)} {(1)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all spids:[539]) op: Equal rhs: {(SQ <'skipping git-cvsserver tests, cvs not found'>)} spids: [539] ) ] spids: [539] ) (C {(test_done)}) ] spids: [16777215 536] ) ] spids: [16777215 547] ) (command.If arms: [ (if_arm cond: [(command.Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:T)] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all spids:[560]) op: Equal rhs: {(SQ <'skipping git-cvsserver tests, perl not available'>)} spids: [560] ) ] spids: [560] ) (C {(test_done)}) ] spids: [16777215 557] ) ] spids: [16777215 568] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(perl)} {(-e)} {(SQ <'use DBI; use DBD::SQLite'>)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all spids:[589]) op: Equal rhs: {(SQ <'skipping git-cvsserver tests, Perl SQLite interface unavailable'>)} spids: [589] ) ] spids: [589] ) (C {(test_done)}) ] spids: [586] ) ] ) (C {(unset)} {(GIT_DIR)} {(GIT_CONFIG)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:WORKDIR spids:[606]) op: Equal rhs: {($ VSub_Name '$PWD')} spids: [606] ) ] spids: [606] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SERVERDIR spids:[609]) op: Equal rhs: {($ VSub_Name '$PWD') (/gitcvs.git)} spids: [609] ) ] spids: [609] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_config spids:[613]) op: Equal rhs: {(DQ ($ VSub_Name '$SERVERDIR') (/config))} spids: [613] ) ] spids: [613] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:CVSROOT spids:[619]) op: Equal rhs: {(DQ (':fork:') ($ VSub_Name '$SERVERDIR'))} spids: [619] ) ] spids: [619] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:CVSWORK spids:[625]) op: Equal rhs: {(DQ ($ VSub_Name '$PWD') (/cvswork))} spids: [625] ) ] spids: [625] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:CVS_SERVER spids:[631]) op: Equal rhs: {(git-cvsserver)} spids: [631] ) ] spids: [631] ) (C {(export)} {(CVSROOT)} {(CVS_SERVER)}) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name '$CVSWORK'))} {(DQ ($ VSub_Name '$SERVERDIR'))}) (C {(test_expect_success)} {(SQ <'setup v1, b1'>)} { (SQ <'\n'> <'\techo "Simple text file" >textfile.c &&\n'> <'\techo "t2" >t2 &&\n'> <'\tmkdir adir &&\n'> <'\techo "adir/afile line1" >adir/afile &&\n'> <'\techo "adir/afile line2" >>adir/afile &&\n'> <'\techo "adir/afile line3" >>adir/afile &&\n'> <'\techo "adir/afile line4" >>adir/afile &&\n'> <'\techo "adir/a2file" >>adir/a2file &&\n'> <'\tmkdir adir/bdir &&\n'> <'\techo "adir/bdir/bfile line 1" >adir/bdir/bfile &&\n'> <'\techo "adir/bdir/bfile line 2" >>adir/bdir/bfile &&\n'> <'\techo "adir/bdir/b2file" >adir/bdir/b2file &&\n'> <'\tgit add textfile.c t2 adir &&\n'> <'\tgit commit -q -m "First Commit (v1)" &&\n'> <'\tgit tag v1 &&\n'> <'\tgit branch b1 &&\n'> <'\tgit clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&\n'> <'\tGIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&\n'> <'\tGIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"\n'> ) } ) (C {(rm)} {(-rf)} {(cvswork)}) (C {(test_expect_success)} {(SQ <'cvs co v1'>)} { (SQ <'\n'> <'\tcvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(rm)} {(-rf)} {(cvswork)}) (C {(test_expect_success)} {(SQ <'cvs co b1'>)} { (SQ <'\n'> <'\tcvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs co b1 [cvswork3]'>)} { (SQ <'\n'> <'\tcvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork3 &&\n'> <'\tcheck_file cvswork3 textfile.c v1 &&\n'> <'\tcheck_file cvswork3 t2 v1 &&\n'> <'\tcheck_file cvswork3 adir/afile v1 &&\n'> <'\tcheck_file cvswork3 adir/a2file v1 &&\n'> <'\tcheck_file cvswork3 adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork3 adir/bdir/b2file v1 &&\n'> <'\tcheck_end_full_tree cvswork3 v1\n'> ) } ) (C {(test_expect_success)} {(SQ <'edit cvswork3 and save diff'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork3 &&\n'> <'\t\tsed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&\n'> <'\t\tmv -f adir/afileNEW adir/afile &&\n'> <'\t\techo "afile5" >adir/afile5 &&\n'> <'\t\trm t2 &&\n'> <'\t\tcvs -f add adir/afile5 &&\n'> <'\t\tcvs -f rm t2 &&\n'> <'\t\t! cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"\n'> <'\t)\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup v1.2 on b1'>)} { (SQ <'\n'> <'\tgit checkout b1 &&\n'> <'\techo "new v1.2" >t3 &&\n'> <'\trm t2 &&\n'> <'\tsed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&\n'> <'\tmv -f adir/afileNEW adir/afile &&\n'> <'\trm adir/a2file &&\n'> <'\techo "a3file" >>adir/a3file &&\n'> <'\techo "bfile line 3" >>adir/bdir/bfile &&\n'> <'\trm adir/bdir/b2file &&\n'> <'\techo "b3file" >adir/bdir/b3file &&\n'> <'\tmkdir cdir &&\n'> <'\techo "cdir/cfile" >cdir/cfile &&\n'> <'\tgit add -A cdir adir t3 t2 &&\n'> <'\tgit commit -q -m '> ) (v1.2) (SQ <' &&\n'> <'\tgit tag v1.2 &&\n'> <'\tgit push --tags gitcvs.git b1:b1\n'>) } ) (C {(test_expect_success)} {(SQ <'cvs -f up (on b1 adir)'>)} { (SQ <'\n'> <'\t( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1.2 &&\n'> <'\tcheck_file cvswork adir/a3file v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/b3file v1.2 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up (on b1 /)'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1.2 &&\n'> <'\tcheck_file cvswork t3 v1.2 &&\n'> <'\tcheck_file cvswork adir/afile v1.2 &&\n'> <'\tcheck_file cvswork adir/a3file v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/b3file v1.2 &&\n'> <'\tcheck_file cvswork cdir/cfile v1.2 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up (on b1 /) (again; check CVS/Tag files)'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1.2 &&\n'> <'\tcheck_file cvswork t3 v1.2 &&\n'> <'\tcheck_file cvswork adir/afile v1.2 &&\n'> <'\tcheck_file cvswork adir/a3file v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/b3file v1.2 &&\n'> <'\tcheck_file cvswork cdir/cfile v1.2 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -r v1'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up (again; check CVS/Tag files)'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup simple b2'>)} {(SQ <'\n'> <'\tgit branch b2 v1 &&\n'> <'\tgit push --tags gitcvs.git b2:b2\n'>)} ) (C {(test_expect_success)} {(SQ <'cvs co b2 [into cvswork2]'>)} { (SQ <'\n'> <'\tcvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_tree cvswork\n'> ) } ) (C {(test_expect_success)} {(SQ <'root dir edit [cvswork2]'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork2 && echo "Line 2" >>textfile.c &&\n'> <'\t\t! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&\n'> <'\t\tcvs -f commit -m "edit textfile.c" textfile.c\n'> <'\t) >cvsEdit1.log 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'root dir rm file [cvswork2]'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork2 &&\n'> <'\t\tcvs -f rm -f t2 &&\n'> <'\t\tcvs -f diff -u >../cvsEdit2-empty.diff &&\n'> <'\t\t! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&\n'> <'\t\tcvs -f commit -m "rm t2"\n'> <'\t) >cvsEdit2.log 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'subdir edit/add/rm files [cvswork2]'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork2 &&\n'> <'\t\tsed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&\n'> <'\t\tmv -f adir/bdir/bfileNEW adir/bdir/bfile &&\n'> <'\t\trm adir/bdir/b2file &&\n'> <'\t\tcd adir &&\n'> <'\t\tcvs -f rm bdir/b2file &&\n'> <'\t\techo "4th file" >bdir/b4file &&\n'> <'\t\tcvs -f add bdir/b4file &&\n'> <'\t\t! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&\n'> <'\t\tgit fetch gitcvs.git b2:b2 &&\n'> <'\t\t(\n'> <'\t\t cd .. &&\n'> <'\t\t ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&\n'> <'\t\t ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"\n'> <'\t\t) &&\n'> <'\t\tcvs -f commit -m "various add/rm/edit"\n'> <'\t) >cvs.log 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'validate result of edits [cvswork2]'>)} { (SQ <'\n'> <'\tgit fetch gitcvs.git b2:b2 &&\n'> <'\tgit tag v2 b2 &&\n'> <'\tgit push --tags gitcvs.git b2:b2 &&\n'> <'\tcheck_start_tree cvswork2 &&\n'> <'\tcheck_file cvswork2 textfile.c v2 &&\n'> <'\tcheck_file cvswork2 adir/afile v2 &&\n'> <'\tcheck_file cvswork2 adir/a2file v2 &&\n'> <'\tcheck_file cvswork2 adir/bdir/bfile v2 &&\n'> <'\tcheck_file cvswork2 adir/bdir/b4file v2 &&\n'> <'\tcheck_end_full_tree cvswork2 v2\n'> ) } ) (C {(test_expect_success)} {(SQ <'validate basic diffs saved during above cvswork2 edits'>)} { (SQ <'\n'> <'\ttest $(grep Index: cvsEdit1.diff | wc -l) = 1 &&\n'> <'\ttest_must_be_empty cvsEdit2-empty.diff &&\n'> <'\ttest $(grep Index: cvsEdit2-N.diff | wc -l) = 1 &&\n'> <'\ttest $(grep Index: cvsEdit3.diff | wc -l) = 3 &&\n'> <'\trm -rf diffSandbox &&\n'> <'\tgit clone -q -n . diffSandbox &&\n'> <'\t(\n'> <'\t\tcd diffSandbox &&\n'> <'\t\tgit checkout v1 &&\n'> <'\t\tgit apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&\n'> <'\t\tgit apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&\n'> <'\t\tgit apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&\n'> <'\t\tgit diff --exit-code v2\n'> <'\t) >"check_diff_apply.out" 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'validate v1.2 diff saved during last cvswork2 edit'>)} { (SQ <'\n'> <'\ttest $(grep Index: cvsEdit3-v1.2.diff | wc -l) = 9 &&\n'> <'\tcheck_diff cvsEdit3-v1.2.diff v1.2 v2\n'> ) } ) (C {(test_expect_success)} {(SQ <'validate v1.2 v1 diff saved during last cvswork2 edit'>)} { (SQ <'\n'> <'\ttest $(grep Index: cvsEdit3-v1.2-v1.diff | wc -l) = 9 &&\n'> <'\tcheck_diff cvsEdit3-v1.2-v1.diff v1.2 v1\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up [cvswork2]'>)} { (SQ <'\n'> <'\t( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork2 &&\n'> <'\tcheck_file cvswork2 textfile.c v2 &&\n'> <'\tcheck_file cvswork2 adir/afile v2 &&\n'> <'\tcheck_file cvswork2 adir/a2file v2 &&\n'> <'\tcheck_file cvswork2 adir/bdir/bfile v2 &&\n'> <'\tcheck_file cvswork2 adir/bdir/b4file v2 &&\n'> <'\tcheck_end_full_tree cvswork2 v2\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -r b2 [back to cvswork]'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v2 &&\n'> <'\tcheck_file cvswork adir/afile v2 &&\n'> <'\tcheck_file cvswork adir/a2file v2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v2 &&\n'> <'\tcheck_file cvswork adir/bdir/b4file v2 &&\n'> <'\tcheck_end_full_tree cvswork v2\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -r b1'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1.2 &&\n'> <'\tcheck_file cvswork t3 v1.2 &&\n'> <'\tcheck_file cvswork adir/afile v1.2 &&\n'> <'\tcheck_file cvswork adir/a3file v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/b3file v1.2 &&\n'> <'\tcheck_file cvswork cdir/cfile v1.2 &&\n'> <'\tcheck_end_full_tree cvswork v1.2\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -A'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_full_tree cvswork v1\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up (check CVS/Tag files)'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_full_tree cvswork v1\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -r heads/b1'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1.2 &&\n'> <'\tcheck_file cvswork t3 v1.2 &&\n'> <'\tcheck_file cvswork adir/afile v1.2 &&\n'> <'\tcheck_file cvswork adir/a3file v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1.2 &&\n'> <'\tcheck_file cvswork adir/bdir/b3file v1.2 &&\n'> <'\tcheck_file cvswork cdir/cfile v1.2 &&\n'> <'\tcheck_end_full_tree cvswork v1.2\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up -r heads_-s-b2 (cvsserver escape mechanism)'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v2 &&\n'> <'\tcheck_file cvswork adir/afile v2 &&\n'> <'\tcheck_file cvswork adir/a2file v2 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v2 &&\n'> <'\tcheck_file cvswork adir/bdir/b4file v2 &&\n'> <'\tcheck_end_full_tree cvswork v2\n'> ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:v1hash spids:[1248]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(git)} {(rev-parse)} {(v1)})]) left_token: <Left_CommandSub '$('> spids: [1249 1255] ) } spids: [1248] ) ] spids: [1248] ) (C {(test_expect_success)} {(SQ <'cvs up -r $(git rev-parse v1)'>)} { (SQ <'\n'> <'\ttest -n "$v1hash" &&\n'> <'\t( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork &&\n'> <'\tcheck_file cvswork textfile.c v1 &&\n'> <'\tcheck_file cvswork t2 v1 &&\n'> <'\tcheck_file cvswork adir/afile v1 &&\n'> <'\tcheck_file cvswork adir/a2file v1 &&\n'> <'\tcheck_file cvswork adir/bdir/bfile v1 &&\n'> <'\tcheck_file cvswork adir/bdir/b2file v1 &&\n'> <'\tcheck_end_full_tree cvswork v1\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs diff -r v1 -u'>)} { (SQ <'\n'> <'\t( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&\n'> <'\ttest_must_be_empty cvsDiff.out &&\n'> <'\ttest_must_be_empty cvs.log\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs diff -N -r v2 -u'>)} { (SQ <'\n'> <'\t( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&\n'> <'\ttest_must_be_empty cvs.log &&\n'> <'\ttest -s cvsDiff.out &&\n'> <'\tcheck_diff cvsDiff.out v2 v1 >check_diff.out 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs diff -N -r v2 -r v1.2'>)} { (SQ <'\n'> <'\t( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&\n'> <'\ttest_must_be_empty cvs.log &&\n'> <'\ttest -s cvsDiff.out &&\n'> <'\tcheck_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'apply early [cvswork3] diff to b3'>)} { (SQ <'\n'> <'\tgit clone -q . gitwork3 &&\n'> <'\t(\n'> <'\t\tcd gitwork3 &&\n'> <'\t\tgit checkout -b b3 v1 &&\n'> <'\t\tgit apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&\n'> <'\t\tgit commit -m "cvswork3 edits applied"\n'> <'\t) &&\n'> <'\tgit fetch gitwork3 b3:b3 &&\n'> <'\tgit tag v3 b3\n'> ) } ) (C {(test_expect_success)} {(SQ <'check [cvswork3] diff'>)} { (SQ <'\n'> <'\t( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&\n'> <'\ttest_must_be_empty cvs.log &&\n'> <'\ttest -s cvsDiff.out &&\n'> <'\ttest $(grep Index: cvsDiff.out | wc -l) = 3 &&\n'> <'\ttest_cmp cvsDiff.out cvswork3edit.diff &&\n'> <'\tcheck_diff cvsDiff.out v1 v3 >check_diff.out 2>&1\n'> ) } ) (C {(test_expect_success)} {(SQ <'merge early [cvswork3] b3 with b1'>)} { (SQ <'\n'> <'\t( cd gitwork3 && git merge -m "message" b1 ) &&\n'> <'\tgit fetch gitwork3 b3:b3 &&\n'> <'\tgit tag v3merged b3 &&\n'> <'\tgit push --tags gitcvs.git b3:b3\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs up dirty [cvswork3]'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork3 &&\n'> <'\t\tcvs -f up &&\n'> <'\t\t! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"\n'> <'\t) >cvs.log 2>&1 &&\n'> <'\ttest -s cvsDiff.out &&\n'> <'\ttest $(grep Index: cvsDiff.out | wc -l) = 2 &&\n'> <'\tcheck_start_tree cvswork3 &&\n'> <'\tcheck_file cvswork3 textfile.c v3merged &&\n'> <'\tcheck_file cvswork3 t3 v3merged &&\n'> <'\tcheck_file cvswork3 adir/afile v3merged &&\n'> <'\tcheck_file cvswork3 adir/a3file v3merged &&\n'> <'\tcheck_file cvswork3 adir/afile5 v3merged &&\n'> <'\tcheck_file cvswork3 adir/bdir/bfile v3merged &&\n'> <'\tcheck_file cvswork3 adir/bdir/b3file v3merged &&\n'> <'\tcheck_file cvswork3 cdir/cfile v3merged &&\n'> <'\tcheck_end_full_tree cvswork3 v3merged\n'> ) } ) (C {(test_expect_success)} {(SQ <'cvs commit [cvswork3]'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd cvswork3 &&\n'> <'\t\tcvs -f commit -m "dirty sandbox after auto-merge"\n'> <'\t) >cvs.log 2>&1 &&\n'> <'\tcheck_start_tree cvswork3 &&\n'> <'\tcheck_file cvswork3 textfile.c v3merged &&\n'> <'\tcheck_file cvswork3 t3 v3merged &&\n'> <'\tcheck_file cvswork3 adir/afile v3merged &&\n'> <'\tcheck_file cvswork3 adir/a3file v3merged &&\n'> <'\tcheck_file cvswork3 adir/afile5 v3merged &&\n'> <'\tcheck_file cvswork3 adir/bdir/bfile v3merged &&\n'> <'\tcheck_file cvswork3 adir/bdir/b3file v3merged &&\n'> <'\tcheck_file cvswork3 cdir/cfile v3merged &&\n'> <'\tcheck_end_full_tree cvswork3 v3merged &&\n'> <'\tgit fetch gitcvs.git b3:b4 &&\n'> <'\tgit tag v4.1 b4 &&\n'> <'\tgit diff --exit-code v4.1 v3merged >check_diff_apply.out 2>&1\n'> ) } ) (C {(test_done)}) ] )