(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git svn authors file tests'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./lib-git-svn.sh'>})
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<svn-authors>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.MultiLine
              here_begin: {<EOF>}
              here_end_span_id: 36
              stdin_parts: [
                <'aa = AAAAAAA AAAAAAA <aa@example.com>\n'>
                <'bb = BBBBBBB BBBBBBB <bb@example.com>\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'setup svnrepo'>)} 
      {
        (SQ <'\n'> <'\tfor i in aa bb cc dd\n'> <'\tdo\n'> 
          <'\t\tsvn_cmd mkdir -m $i --username $i "$svnrepo"/$i\n'> <'\tdone\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'start import with incomplete authors file'>)} 
      {
        (SQ <'\n'> <'\ttest_must_fail git svn clone --authors-file=svn-authors "$svnrepo" x\n'> <'\t'>)
      }
    )
    (C {<test_expect_success>} {(SQ <'imported 2 revisions successfully'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd x\n'> 
          <'\t\ttest "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 2 &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n'> 
          <'\t\t  grep "^author BBBBBBB BBBBBBB <bb@example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n'> 
          <'\t\t  grep "^author AAAAAAA AAAAAAA <aa@example\\.com> "\n'> <'\t)\n'> <'\t'>
        )
      }
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<svn-authors>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.MultiLine
              here_begin: {<EOF>}
              here_end_span_id: 99
              stdin_parts: [
                <'cc = CCCCCCC CCCCCCC <cc@example.com>\n'>
                <'dd = DDDDDDD DDDDDDD <dd@example.com>\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'continues to import once authors have been added'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd x\n'> <'\t\tgit svn fetch --authors-file=../svn-authors &&\n'> 
          <'\t\ttest "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 4 &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n'> 
          <'\t\t  grep "^author DDDDDDD DDDDDDD <dd@example\\.com> " &&\n'> <'\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n'> 
          <'\t\t  grep "^author CCCCCCC CCCCCCC <cc@example\\.com> "\n'> <'\t)\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'authors-file against globs'>)} 
      {
        (SQ <'\n'> <'\tsvn_cmd mkdir -m globs --username aa \\\n'> 
          <'\t  "$svnrepo"/aa/trunk "$svnrepo"/aa/branches "$svnrepo"/aa/tags &&\n'> <'\tgit svn clone --authors-file=svn-authors -s "$svnrepo"/aa aa-work &&\n'> <'\tfor i in bb ee cc\n'> 
          <'\tdo\n'> <'\t\tbranch="aa/branches/$i"\n'> 
          <'\t\tsvn_cmd mkdir -m "$branch" --username $i "$svnrepo/$branch"\n'> <'\tdone\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'fetch fails on ee'>)} 
      {
        (SQ <'\n'> 
          <'\t( cd aa-work && test_must_fail git svn fetch --authors-file=../svn-authors )\n'> <'\t'>
        )
      }
    )
    (command.ShFunction
      name: tmp_config_get
      body: 
        (BraceGroup
          children: [
            (C {<git>} {<config>} {<--file> <Id.Lit_Equals '='> <'.git/svn/.metadata'>} {<--get>} 
              {(DQ ($ Id.VSub_Number '$1'))}
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'failure happened without negative side effects'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd aa-work &&\n'> 
          <'\t\ttest 6 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&\n'> <'\t\ttest 6 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"\n'> <'\t)\n'> <'\t'>
        )
      }
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<svn-authors>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.MultiLine
              here_begin: {<EOF>}
              here_end_span_id: 208
              stdin_parts: [<'ee = EEEEEEE EEEEEEE <ee@example.com>\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'fetch continues after authors-file is fixed'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd aa-work &&\n'> 
          <'\t\tgit svn fetch --authors-file=../svn-authors &&\n'> <'\t\ttest 8 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&\n'> 
          <'\t\ttest 8 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"\n'> <'\t)\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} 
      {(SQ <'fresh clone with svn.authors-file in config'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\trm -r "$GIT_DIR" &&\n'> 
          <'\t\ttest x = x"$(git config svn.authorsfile)" &&\n'> <'\t\ttest_config="$HOME"/.gitconfig &&\n'> <'\t\tsane_unset GIT_DIR &&\n'> 
          <'\t\tgit config --global \\\n'> <'\t\t  svn.authorsfile "$HOME"/svn-authors &&\n'> 
          <'\t\ttest x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&\n'> <'\t\tgit svn clone "$svnrepo" gitconfig.clone &&\n'> <'\t\tcd gitconfig.clone &&\n'> 
          <'\t\tnr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&\n'> <'\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n'> <'\t\ttest $nr_rev -eq $nr_ex\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_debug>} {(SQ <'GIT_DIR=gitconfig.clone/.git git log'>)})
    (C {<test_done>})
  ]
)