(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          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: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: check_start_tree
      body: 
        (BraceGroup
          children: [
            (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))})
            (SimpleCommand
              words: [{(echo)} {(DQ ('start ') ($ VSub_Number '$1'))}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(DQ (${ VSub_Name WORKDIR) (/check.log))}
                  spids: [46]
                )
              ]
            )
          ]
          spids: [26]
        )
      spids: [22 25]
    )
    (FuncDef
      name: check_file
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:sandbox)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [64]
                )
              ]
              spids: [64]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:file)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [70]
                )
              ]
              spids: [70]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ver)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$3'))}
                  spids: [76]
                )
              ]
              spids: [76]
            )
            (SimpleCommand
              words: [{(git)} {(show)} {(DQ (${ VSub_Name ver) (':') (${ VSub_Name file))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.got))}
                  spids: [101]
                )
                (Redir
                  op_id: Redir_Great
                  fd: 2
                  arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.stderr))}
                  spids: [107]
                )
              ]
              more_env: [(env_pair name:GIT_DIR val:{($ VSub_Name '$SERVERDIR')} spids:[82])]
            )
            (C {(test_cmp)} {(DQ ($ VSub_Name '$WORKDIR') (/check.got))} 
              {(DQ ($ VSub_Name '$sandbox') (/) ($ VSub_Name '$file'))}
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:stat)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [128]
                )
              ]
              spids: [128]
            )
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ('check_file ') ($ VSub_Name '$sandbox') (' ') ($ VSub_Name '$file') (' ') 
                    ($ VSub_Name '$ver') (' : ') ($ VSub_Name '$stat')
                  )
                }
              ]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/check.log))}
                  spids: [145]
                )
              ]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Name '$file'))}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))}
                  spids: [158]
                )
              ]
            )
            (ControlFlow
              token: <ControlFlow_Return return>
              arg_word: {($ VSub_Name '$stat')}
            )
          ]
          spids: [61]
        )
      spids: [57 60]
    )
    (FuncDef
      name: check_end_tree
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:sandbox)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$1'))}
                      spids: [179]
                    )
                  ]
                  spids: [179]
                )
                (SimpleCommand
                  words: [
                    {(find)}
                    {(DQ ($ VSub_Name '$sandbox'))}
                    {(-name)}
                    {(CVS)}
                    {(-prune)}
                    {(-o)}
                    {(-type)}
                    {(f)}
                    {(-print)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.actual))}
                      spids: [207]
                    )
                  ]
                )
                (SimpleCommand
                  words: [{(sort)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Less
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))}
                      spids: [218]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(expected)}
                      spids: [224]
                    )
                  ]
                )
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(sort)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Less
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.actual))}
                          spids: [232]
                        )
                      ]
                    )
                    (SimpleCommand
                      words: [{(sed)} {(-e)} {(DQ ('s%cvswork/%%'))}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(actual)}
                          spids: [248]
                        )
                      ]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(expected)} {(actual)})
                (C {(rm)} {(expected)} {(actual)})
              ]
            )
          ]
          spids: [176]
        )
      spids: [172 175]
    )
    (FuncDef
      name: check_end_full_tree
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:sandbox)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$1'))}
                      spids: [279]
                    )
                  ]
                  spids: [279]
                )
                (SimpleCommand
                  words: [{(sort)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Less
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$WORKDIR') (/list.expected))}
                      spids: [289]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(expected)}
                      spids: [295]
                    )
                  ]
                )
                (Pipeline
                  children: [
                    (C {(find)} {(DQ ($ VSub_Name '$sandbox'))} {(-name)} {(CVS)} {(-prune)} {(-o)} 
                      {(-type)} {(f)} {(-print)}
                    )
                    (C {(sed)} {(-e)} {(DQ ('s%') ($ VSub_Name '$sandbox') ('/%%'))})
                    (SimpleCommand
                      words: [{(sort)}]
                      redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(act1)} spids:[338])]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(expected)} {(act1)})
                (Pipeline
                  children: [
                    (C {(git)} {(ls-tree)} {(--name-only)} {(-r)} {(DQ ($ VSub_Number '$2'))})
                    (SimpleCommand
                      words: [{(sort)}]
                      redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(act2)} spids:[369])]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(expected)} {(act2)})
                (C {(rm)} {(expected)} {(act1)} {(act2)})
              ]
            )
          ]
          spids: [276]
        )
      spids: [272 275]
    )
    (FuncDef
      name: check_diff
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:diffFile)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [406]
                )
              ]
              spids: [406]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:vOld)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [412]
                )
              ]
              spids: [412]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:vNew)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$3'))}
                  spids: [418]
                )
              ]
              spids: [418]
            )
            (C {(rm)} {(-rf)} {(diffSandbox)})
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(git)} {(clone)} {(-q)} {(-n)} {(.)} {(diffSandbox)})
                (Subshell
                  child: 
                    (AndOr
                      ops: [Op_DAmp Op_DAmp Op_DAmp]
                      children: [
                        (C {(cd)} {(diffSandbox)})
                        (C {(git)} {(checkout)} {(DQ ($ VSub_Name '$vOld'))})
                        (SimpleCommand
                          words: [{(git)} {(apply)} {(-p0)} {(--index)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Less
                              fd: 16777215
                              arg_word: {(DQ (../) ($ VSub_Name '$diffFile'))}
                              spids: [475]
                            )
                          ]
                        )
                        (C {(git)} {(diff)} {(--exit-code)} {(DQ ($ VSub_Name '$vNew'))})
                      ]
                    )
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(check_diff_apply.out)}
                      spids: [497]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[500])
                  ]
                  spids: [446 495]
                )
              ]
            )
          ]
          spids: [403]
        )
      spids: [399 402]
    )
    (SimpleCommand
      words: [{(cvs)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[512])
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[515])
      ]
    )
    (If
      arms: [
        (if_arm
          cond: [(C {(test)} {($ VSub_QMark '$?')} {(-ne)} {(1)})]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping git-cvsserver tests, cvs not found'>)}
                  spids: [531]
                )
              ]
              spids: [531]
            )
            (C {(test_done)})
          ]
          spids: [16777215 528]
        )
      ]
      spids: [16777215 539]
    )
    (If
      arms: [
        (if_arm
          cond: [(Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:T)]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping git-cvsserver tests, perl not available'>)}
                  spids: [552]
                )
              ]
              spids: [552]
            )
            (C {(test_done)})
          ]
          spids: [16777215 549]
        )
      ]
      spids: [16777215 560]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (SimpleCommand
          words: [{(perl)} {(-e)} {(SQ <'use DBI; use DBD::SQLite'>)}]
          redirects: [
            (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[570])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[573])
          ]
        )
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:skip_all)
                  op: Equal
                  rhs: {(SQ <'skipping git-cvsserver tests, Perl SQLite interface unavailable'>)}
                  spids: [581]
                )
              ]
              spids: [581]
            )
            (C {(test_done)})
          ]
          spids: [578]
        )
      ]
    )
    (C {(unset)} {(GIT_DIR)} {(GIT_CONFIG)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:WORKDIR)
          op: Equal
          rhs: {($ VSub_Name '$PWD')}
          spids: [598]
        )
      ]
      spids: [598]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SERVERDIR)
          op: Equal
          rhs: {($ VSub_Name '$PWD') (/gitcvs.git)}
          spids: [601]
        )
      ]
      spids: [601]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:git_config)
          op: Equal
          rhs: {(DQ ($ VSub_Name '$SERVERDIR') (/config))}
          spids: [605]
        )
      ]
      spids: [605]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CVSROOT)
          op: Equal
          rhs: {(DQ (':fork:') ($ VSub_Name '$SERVERDIR'))}
          spids: [611]
        )
      ]
      spids: [611]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CVSWORK)
          op: Equal
          rhs: {(DQ ($ VSub_Name '$PWD') (/cvswork))}
          spids: [617]
        )
      ]
      spids: [617]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:CVS_SERVER) op:Equal rhs:{(git-cvsserver)} spids:[623])]
      spids: [623]
    )
    (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'>
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:v1hash)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(git)} {(rev-parse)} {(v1)})])
                left_token: <Left_CommandSub '$('>
                spids: [1241 1247]
              )
            }
          spids: [1240]
        )
      ]
      spids: [1240]
    )
    (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)})
  ]
)