(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <"git-cvsserver access\n"> <"\n"> 
                <"tests read access to a git repository with the\n"> <"cvs CLI client via git-cvsserver server">
              )
            }
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:True)
              terminator: <Op_Semi ";">
            )
          ]
          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: [39]
                )
              ]
              spids: [39]
            )
            (C {(test_done)})
          ]
          spids: [-1 36]
        )
      ]
      spids: [-1 47]
    )
    (SimpleCommand
      words: [{(cvs)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[51])
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[54])
      ]
    )
    (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: [70]
                )
              ]
              spids: [70]
            )
            (C {(test_done)})
          ]
          spids: [-1 67]
        )
      ]
      spids: [-1 78]
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(perl)} {(-e)} {(SQ <"use DBI; use DBD::SQLite">)}]
          redirects: [
            (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[88])
            (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[91])
          ]
        )
        (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: [99]
                )
              ]
              spids: [99]
            )
            (C {(test_done)})
          ]
          spids: [96]
        )
      ]
      op_id: Op_DPipe
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:WORKDIR)
          op: Equal
          rhs: {($ VSub_Name "$PWD")}
          spids: [110]
        )
      ]
      spids: [110]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SERVERDIR)
          op: Equal
          rhs: {($ VSub_Name "$PWD") (/gitcvs.git)}
          spids: [113]
        )
      ]
      spids: [113]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:git_config)
          op: Equal
          rhs: {(DQ ($ VSub_Name "$SERVERDIR") (/config))}
          spids: [117]
        )
      ]
      spids: [117]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CVSROOT)
          op: Equal
          rhs: {(DQ (":fork:") ($ VSub_Name "$SERVERDIR"))}
          spids: [123]
        )
      ]
      spids: [123]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CVSWORK)
          op: Equal
          rhs: {(DQ ($ VSub_Name "$PWD") (/cvswork))}
          spids: [129]
        )
      ]
      spids: [129]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:CVS_SERVER) op:Equal rhs:{(git-cvsserver)} spids:[135])]
      spids: [135]
    )
    (C {(export)} {(CVSROOT)} {(CVS_SERVER)})
    (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$CVSWORK"))} {(DQ ($ VSub_Name "$SERVERDIR"))})
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <"\n"> <"  git config push.default matching &&\n"> <"  echo >empty &&\n"> 
          <"  git add empty &&\n"> <"  git commit -q -m \"First Commit\" &&\n"> <"  mkdir secondroot &&\n"> <"  ( cd secondroot &&\n"> 
          <"  git init &&\n"> <"  touch secondrootfile &&\n"> <"  git add secondrootfile &&\n"> 
          <"  git commit -m \"second root\") &&\n"> <"  git fetch secondroot master &&\n"> <"  git merge --allow-unrelated-histories FETCH_HEAD &&\n"> 
          <"  git clone -q --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n"> <"  GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n"> 
          <"  GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" &&\n"> <"  GIT_DIR=\"$SERVERDIR\" git config gitcvs.authdb \"$SERVERDIR/auth.db\" &&\n"> 
          <"  echo cvsuser:cvGVEarMLnhlA > \"$SERVERDIR/auth.db\"\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"basic checkout">)} 
      {
        (SQ <"GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork master &&\n"> 
          <
"   test \"$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))\" = \"empty/1.1/\" &&\n"
          > 
          <
"   test \"$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \\$p))\" = \"secondrootfile/1.1/\""
          >
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(request-anonymous)} spids:[218])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN AUTH REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("anonymous\n") ("\n") 
                ("END AUTH REQUEST\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [221]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(request-git)} spids:[233])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN AUTH REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("git\n") ("\n") 
                ("END AUTH REQUEST\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [236]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(login-anonymous)} spids:[248])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN VERIFICATION REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("anonymous\n") 
                ("\n") ("END VERIFICATION REQUEST\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [251]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(login-git)} spids:[263])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN VERIFICATION REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("git\n") ("\n") 
                ("END VERIFICATION REQUEST\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [266]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(login-git-ok)} spids:[278])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN VERIFICATION REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("cvsuser\n") 
                ("Ah<Z:yZZ30 e\n") ("END VERIFICATION REQUEST\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [281]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"pserver authentication">)} 
      {
        (SQ <"cat request-anonymous | git-cvsserver pserver >log 2>&1 &&\n"> 
          <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"pserver authentication failure (non-anonymous user)">)} 
      {
        (SQ <"if cat request-git | git-cvsserver pserver >log 2>&1\n"> <"   then\n"> <"       false\n"> 
          <"   else\n"> <"       true\n"> <"   fi &&\n"> <"   sed -ne \\$p log | grep \"^I HATE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"pserver authentication success (non-anonymous user with password)">)} 
      {
        (SQ <"cat login-git-ok | git-cvsserver pserver >log 2>&1 &&\n"> 
          <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"pserver authentication (login)">)} 
      {
        (SQ <"cat login-anonymous | git-cvsserver pserver >log 2>&1 &&\n"> 
          <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"pserver authentication failure (login/non-anonymous user)">)} 
      {
        (SQ <"if cat login-git | git-cvsserver pserver >log 2>&1\n"> <"   then\n"> <"       false\n"> 
          <"   else\n"> <"       true\n"> <"   fi &&\n"> <"   sed -ne \\$p log | grep \"^I HATE YOU\\$\"">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(request-relative)} spids:[378])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN AUTH REQUEST\n") ("gitcvs.git\n") ("anonymous\n") ("\n") ("END AUTH REQUEST\n"))
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [381]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(request-conflict)} spids:[392])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN AUTH REQUEST\n") ($ VSub_Name "$SERVERDIR") ("\n") ("anonymous\n") ("\n") 
                ("END AUTH REQUEST\n") ("Root ") ($ VSub_Name "$WORKDIR") ("\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [395]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (relative pathname)">)} 
      {
        (SQ <"if cat request-relative | git-cvsserver pserver >log 2>&1\n"> <"   then\n"> 
          <"       echo unexpected success\n"> <"       false\n"> <"   else\n"> <"       true\n"> <"   fi &&\n"> 
          <"   tail log | grep \"^error 1 Root must be an absolute pathname$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (conflicting roots)">)} 
      {
        (SQ <"cat request-conflict | git-cvsserver pserver >log 2>&1 &&\n"> 
          <"   tail log | grep \"^error 1 Conflicting roots specified$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root (strict paths)">)} 
      {
        (SQ 
          <
"cat request-anonymous | git-cvsserver --strict-paths pserver \"$SERVERDIR\" >log 2>&1 &&\n"
          > <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (strict-paths)">)} 
      {
        (SQ <"\n"> <"    ! cat request-anonymous |\n"> 
          <"    git-cvsserver --strict-paths pserver \"$WORKDIR\" >log 2>&1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root (w/o strict-paths)">)} 
      {
        (SQ <"cat request-anonymous | git-cvsserver pserver \"$WORKDIR/\" >log 2>&1 &&\n"> 
          <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (w/o strict-paths)">)} 
      {
        (SQ <"\n"> <"    ! cat request-anonymous |\n"> 
          <"    git-cvsserver pserver \"$WORKDIR/gitcvs\" >log 2>&1\n">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(request-base)} spids:[498])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("BEGIN AUTH REQUEST\n") ("/gitcvs.git\n") ("anonymous\n") ("\n") 
                ("END AUTH REQUEST\n") ("Root /gitcvs.git\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [501]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"req_Root (base-path)">)} 
      {
        (SQ 
          <
"cat request-base | git-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n"
          > <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (base-path)">)} 
      {
        (SQ <"\n"> <"    ! cat request-anonymous |\n"> 
          <
"    git-cvsserver --strict-paths --base-path \"$WORKDIR\" pserver \"$SERVERDIR\" >log 2>&1\n"
          >
        )
      }
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(git)} {(config)} {(--bool)} {(gitcvs.enabled)} {(false)}]
          more_env: [(env_pair name:GIT_DIR val:{(DQ ($ VSub_Name "$SERVERDIR"))} spids:[538])]
        )
        (C {(exit)} {(1)})
      ]
      op_id: Op_DPipe
    )
    (C {(test_expect_success)} {(SQ <"req_Root (export-all)">)} 
      {
        (SQ 
          <
"cat request-anonymous | git-cvsserver --export-all pserver \"$WORKDIR\" >log 2>&1 &&\n"
          > <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"req_Root failure (export-all w/o whitelist)">)} 
      {(SQ <"! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)">)}
    )
    (C {(test_expect_success)} {(SQ <"req_Root (everything together)">)} 
      {
        (SQ 
          <
"cat request-base | git-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n"
          > <"   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"">
        )
      }
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(git)} {(config)} {(--bool)} {(gitcvs.enabled)} {(true)}]
          more_env: [(env_pair name:GIT_DIR val:{(DQ ($ VSub_Name "$SERVERDIR"))} spids:[601])]
        )
        (C {(exit)} {(1)})
      ]
      op_id: Op_DPipe
    )
    (C {(test_expect_success)} {(SQ <"gitcvs.enabled = false">)} 
      {
        (SQ <"GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false &&\n"> 
          <"   if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1\n"> <"   then\n"> <"     echo unexpected cvs success\n"> <"     false\n"> <"   else\n"> <"     true\n"> 
          <"   fi &&\n"> <"   grep \"GITCVS emulation disabled\" cvs.log &&\n"> <"   test ! -d cvswork2">
        )
      }
    )
    (C {(rm)} {(-fr)} {(cvswork2)})
    (C {(test_expect_success)} {(SQ <"gitcvs.ext.enabled = true">)} 
      {
        (SQ <"GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n"> 
          <"   GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n"> 
          <"   test_cmp cvswork cvswork2">
        )
      }
    )
    (C {(rm)} {(-fr)} {(cvswork2)})
    (C {(test_expect_success)} {(SQ <"gitcvs.ext.enabled = false">)} 
      {
        (SQ <"GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled false &&\n"> 
          <"   GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n"> <"   if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1\n"> <"   then\n"> 
          <"     echo unexpected cvs success\n"> <"     false\n"> <"   else\n"> <"     true\n"> <"   fi &&\n"> 
          <"   grep \"GITCVS emulation disabled\" cvs.log &&\n"> <"   test ! -d cvswork2">
        )
      }
    )
    (C {(rm)} {(-fr)} {(cvswork2)})
    (C {(test_expect_success)} {(SQ <gitcvs.dbname>)} 
      {
        (SQ <"GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n"> 
          <"   GIT_DIR=\"$SERVERDIR\" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n"> 
          <"   test_cmp cvswork cvswork2 &&\n"> <"   test -f \"$SERVERDIR/gitcvs.ext.master.sqlite\" &&\n"> 
          <"   cmp \"$SERVERDIR/gitcvs.master.sqlite\" \"$SERVERDIR/gitcvs.ext.master.sqlite\"">
        )
      }
    )
    (C {(rm)} {(-fr)} {(cvswork2)})
    (C {(test_expect_success)} {(SQ <gitcvs.ext.dbname>)} 
      {
        (SQ <"GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.ext.enabled true &&\n"> 
          <"   GIT_DIR=\"$SERVERDIR\" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&\n"> <"   GIT_DIR=\"$SERVERDIR\" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n"> <"   test_cmp cvswork cvswork2 &&\n"> <"   test -f \"$SERVERDIR/gitcvs1.ext.master.sqlite\" &&\n"> 
          <"   test ! -f \"$SERVERDIR/gitcvs2.ext.master.sqlite\" &&\n"> <"   cmp \"$SERVERDIR/gitcvs.master.sqlite\" \"$SERVERDIR/gitcvs1.ext.master.sqlite\"">
        )
      }
    )
    (C {(rm)} {(-fr)} {(DQ ($ VSub_Name "$SERVERDIR"))})
    (AndOr
      children: [
        (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
        (AndOr
          children: [
            (SimpleCommand
              words: [
                {(git)}
                {(clone)}
                {(-q)}
                {(--bare)}
                {(DQ ($ VSub_Name "$WORKDIR") (/.git))}
                {(DQ ($ VSub_Name "$SERVERDIR"))}
              ]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[800])
                (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[803])
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(git)} {(config)} {(--bool)} {(gitcvs.enabled)} {(true)}]
                  more_env: [
                    (env_pair
                      name: GIT_DIR
                      val: {(DQ ($ VSub_Name "$SERVERDIR"))}
                      spids: [808]
                    )
                  ]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [
                        {(git)}
                        {(config)}
                        {(gitcvs.logfile)}
                        {(DQ ($ VSub_Name "$SERVERDIR") (/gitcvs.log))}
                      ]
                      more_env: [
                        (env_pair
                          name: GIT_DIR
                          val: {(DQ ($ VSub_Name "$SERVERDIR"))}
                          spids: [825]
                        )
                      ]
                    )
                    (C {(exit)} {(1)})
                  ]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DAmp
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"cvs update (create new file)">)} 
      {
        (SQ <"echo testfile1 >testfile1 &&\n"> <"   git add testfile1 &&\n"> 
          <"   git commit -q -m \"Add testfile1\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.1/\" &&\n"> 
          <"   test_cmp testfile1 ../testfile1">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (update existing file)">)} 
      {
        (SQ <"echo line 2 >>testfile1 &&\n"> <"   git add testfile1 &&\n"> 
          <"   git commit -q -m \"Append to testfile1\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.2/\" &&\n"> 
          <"   test_cmp testfile1 ../testfile1">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_failure)} {(DQ ("cvs update w/o -d doesn't create subdir (TODO)"))} 
      {
        (SQ <"\n"> <"   mkdir test &&\n"> <"   echo >test/empty &&\n"> <"   git add test &&\n"> 
          <"   git commit -q -m \"Single Subdirectory\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test ! -d test\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (subdirectories)">)} 
      {
        (SQ <"(for dir in A A/B A/B/C A/D E; do\n"> <"      mkdir $dir &&\n"> 
          <
"      echo \"test file in $dir\" >\"$dir/file_in_$(echo $dir|sed -e \"s#/# #g\")\"  &&\n"
          > <"      git add $dir;\n"> <"   done) &&\n"> 
          <"   git commit -q -m \"deep sub directory structure\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update -d &&\n"> <"   (for dir in A A/B A/B/C A/D E; do\n"> 
          <"      filename=\"file_in_$(echo $dir|sed -e \"s#/# #g\")\" &&\n"> 
          <
"      if test \"$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))\" = \"$filename/1.1/\" &&\n"
          > <"\ttest_cmp \"$dir/$filename\" \"../$dir/$filename\"; then\n"> <"        :\n"> <"      else\n"> 
          <"        echo >failure\n"> <"      fi\n"> <"    done) &&\n"> <"   test ! -f failure">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (delete file)">)} 
      {
        (SQ <"git rm testfile1 &&\n"> <"   git commit -q -m \"Remove testfile1\" &&\n"> 
          <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> 
          <"   test -z \"$(grep testfile1 CVS/Entries)\" &&\n"> <"   test ! -f testfile1">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (re-add deleted file)">)} 
      {
        (SQ <"echo readded testfile >testfile1 &&\n"> <"   git add testfile1 &&\n"> 
          <"   git commit -q -m \"Re-Add testfile1\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test \"$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))\" = \"testfile1/1.4/\" &&\n"> 
          <"   test_cmp testfile1 ../testfile1">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (merge)">)} 
      {
        (SQ <"echo Line 0 >expected &&\n"> <"   for i in 1 2 3 4 5 6 7\n"> <"   do\n"> 
          <"     echo Line $i >>merge\n"> <"     echo Line $i >>expected\n"> <"   done &&\n"> <"   echo Line 8 >>expected &&\n"> 
          <"   git add merge &&\n"> <"   git commit -q -m \"Merge test (pre-merge)\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> 
          <"   cd cvswork &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> 
          <"   test \"$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))\" = \"merge/1.1/\" &&\n"> <"   test_cmp merge ../merge &&\n"> <"   ( echo Line 0; cat merge ) >merge.tmp &&\n"> 
          <"   mv merge.tmp merge &&\n"> <"   cd \"$WORKDIR\" &&\n"> <"   echo Line 8 >>merge &&\n"> <"   git add merge &&\n"> 
          <"   git commit -q -m \"Merge test (merge)\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> <"   cd cvswork &&\n"> <"   sleep 1 && touch merge &&\n"> 
          <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test_cmp merge ../expected">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected.C)} spids:[1062])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("<<<<<<< merge.mine\n") ("Line 0\n") ("=======\n") ("LINE 0\n") 
                (">>>>>>> merge.1.3\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1065]
        )
      ]
    )
    (ForEach
      iter_name: i
      iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(echo)} {(Line)} {($ VSub_Name "$i")}]
              redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(expected.C)} spids:[1105])]
            )
          ]
          spids: [1096 1108]
        )
      spids: [1079 -1]
    )
    (C {(test_expect_success)} {(SQ <"cvs update (conflict merge)">)} 
      {
        (SQ <"( echo LINE 0; cat merge ) >merge.tmp &&\n"> <"   mv merge.tmp merge &&\n"> 
          <"   git add merge &&\n"> <"   git commit -q -m \"Merge test (conflict)\" &&\n"> <"   git push gitcvs.git >/dev/null &&\n"> 
          <"   cd cvswork &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"   test_cmp merge ../expected.C">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (-C)">)} 
      {
        (SQ <"cd cvswork &&\n"> <"   GIT_CONFIG=\"$git_config\" cvs -Q update -C &&\n"> 
          <"   test_cmp merge ../merge">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (merge no-op)">)} 
      {
        (SQ <"echo Line 9 >>merge &&\n"> <"    cp merge cvswork/merge &&\n"> <"    git add merge &&\n"> 
          <"    git commit -q -m \"Merge test (no-op)\" &&\n"> <"    git push gitcvs.git >/dev/null &&\n"> <"    cd cvswork &&\n"> <"    sleep 1 && touch merge &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs -Q update &&\n"> <"    test_cmp merge ../merge">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (-p)">)} 
      {
        (SQ <"\n"> <"    touch really-empty &&\n"> <"    echo Line 1 > no-lf &&\n"> 
          <"    printf \"Line 2\" >> no-lf &&\n"> <"    git add really-empty no-lf &&\n"> <"    git commit -q -m \"Update -p test\" &&\n"> 
          <"    git push gitcvs.git >/dev/null &&\n"> <"    cd cvswork &&\n"> <"    GIT_CONFIG=\"$git_config\" cvs update &&\n"> <"    rm -f failures &&\n"> 
          <"    for i in merge no-lf empty really-empty; do\n"> <"        GIT_CONFIG=\"$git_config\" cvs update -p \"$i\" >$i.out\n"> 
          <"\ttest_cmp $i.out ../$i >>failures 2>&1\n"> <"    done &&\n"> <"    test -z \"$(cat failures)\"\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs update (module list supports packed refs)">)} 
      {
        (SQ <"\n"> <"    GIT_DIR=\"$SERVERDIR\" git pack-refs --all &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs -n up -d 2> out &&\n"> <"    grep \"cvs update: New directory \\`master">
        ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <"\" < out\n">)
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs status">)} 
      {
        (SQ <"\n"> <"    mkdir status.dir &&\n"> <"    echo Line > status.dir/status.file &&\n"> 
          <"    echo Line > status.file &&\n"> <"    git add status.dir status.file &&\n"> <"    git commit -q -m \"Status test\" &&\n"> 
          <"    git push gitcvs.git >/dev/null &&\n"> <"    cd cvswork &&\n"> <"    GIT_CONFIG=\"$git_config\" cvs update &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs status | grep \"^File: status.file\" >../out &&\n"> <"    test_line_count = 2 ../out\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs status (nonrecursive)">)} 
      {
        (SQ <"\n"> <"    cd cvswork &&\n"> 
          <
"    GIT_CONFIG=\"$git_config\" cvs status -l | grep \"^File: status.file\" >../out &&\n"
          > <"    test_line_count = 1 ../out\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs status (no subdirs in header)">)} 
      {
        (SQ <"\n"> <"    cd cvswork &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs status | grep ^File: >../out &&\n"> <"    ! grep / <../out\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs co -c (shows module database)">)} 
      {
        (SQ <"\n"> <"    GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n"> 
          <"    grep \"^master[\t ][ \t]*master$\" <out &&\n"> <"    ! grep -v \"^master[\t ][ \t]*master$\" <out\n">
        )
      }
    )
    (SimpleCommand
      words: [{(sed)} {(-e)} {(SQ <"s/^x//">)} {(-e)} {(SQ <"s/SP$/ /">)}]
      redirects: [
        (Redir
          op_id: Redir_Great
          fd: -1
          arg_word: {(DQ ($ VSub_Name "$WORKDIR") (/expect))}
          spids: [1414]
        )
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("x\n") ("xRCS file: ") ($ VSub_Name "$WORKDIR") ("/gitcvs.git/master/merge,v\n") 
                ("xWorking file: merge\n") ("xhead: 1.4\n") ("xbranch:\n") ("xlocks: strict\n") ("xaccess list:\n") ("xsymbolic names:\n") 
                ("xkeyword substitution: kv\n") ("xtotal revisions: 4;\tselected revisions: 4\n") ("xdescription:\n") 
                ("x----------------------------\n") ("xrevision 1.4\n") ("xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3\n") ("x\n") 
                ("xMerge test (no-op)\n") ("xSP\n") ("x----------------------------\n") ("xrevision 1.3\n") 
                ("xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3\n") ("x\n") ("xMerge test (conflict)\n") ("xSP\n") ("x----------------------------\n") ("xrevision 1.2\n") 
                ("xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3\n") ("x\n") ("xMerge test (merge)\n") ("xSP\n") ("x----------------------------\n") ("xrevision 1.1\n") 
                ("xdate: __DATE__;  author: author;  state: Exp;  lines: +2 -3\n") ("x\n") ("xMerge test (pre-merge)\n") ("xSP\n") 
                (
"x=============================================================================\n"
                )
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1421]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:expectStat)
          op: Equal
          rhs: {(DQ ($ VSub_QMark "$?"))}
          spids: [1462]
        )
      ]
      spids: [1462]
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs log">)} 
      {
        (SQ <"\n"> <"    cd cvswork &&\n"> <"    test x\"$expectStat\" = x\"0\" &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs log merge >../out &&\n"> 
          <
"    sed -e \"s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%\" ../out > ../actual &&\n"
          > <"    test_cmp ../expect ../actual\n">
        )
      }
    )
    (C {(cd)} {(DQ ($ VSub_Name "$WORKDIR"))})
    (C {(test_expect_success)} {(SQ <"cvs annotate">)} 
      {
        (SQ <"\n"> <"    cd cvswork &&\n"> 
          <"    GIT_CONFIG=\"$git_config\" cvs annotate merge >../out &&\n"> <"    sed -e \"s/ .*//\" ../out >../actual &&\n"> 
          <"    for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&\n"> <"    test_cmp ../expect ../actual\n">
        )
      }
    )
    (C {(test_done)})
  ]
)