(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git svn propset tests'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./lib-git-svn.sh'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:foo_subdir2)
          op: assign_op.Equal
          rhs: {(DQ <'subdir/subdir2/foo_subdir2'>)}
          spids: [24]
        )
      ]
    )
    (C {<set>} {<-e>})
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<mkdir>} {<Id.KW_Import import>})
        (command.Subshell
          child: 
            (command.CommandList
              children: [
                (command.Sentence child:(C {<set>} {<-e>}) terminator:<Id.Op_Semi _>)
                (C {<cd>} {<Id.KW_Import import>})
                (C {<mkdir>} {<subdir>})
                (C {<mkdir>} {<'subdir/subdir2'>})
                (C {<touch>} {<foo>})
                (C {<touch>} {<'subdir/foo_subdir'>})
                (C {<touch>} {(DQ ($ Id.VSub_DollarName '$foo_subdir2'))})
                (command.Simple
                  words: [
                    {<svn_cmd>}
                    {<Id.KW_Import import>}
                    {<-m>}
                    {(SQ <'import for git svn'>)}
                    {<.>}
                    {(DQ ($ Id.VSub_DollarName '$svnrepo'))}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
              ]
            )
        )
      ]
    )
    (C {<rm>} {<-rf>} {<Id.KW_Import import>})
    (C {<test_expect_success>} {(SQ <'initialize git svn'>)} 
      {(SQ <'\n'> <'\tgit svn init "$svnrepo"\n'> <'\t'>)}
    )
    (C {<test_expect_success>} {(SQ <'fetch revisions from svn'>)} 
      {(SQ <'\n'> <'\tgit svn fetch\n'> <'\t'>)}
    )
    (command.ShFunction
      name: set_props
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:subdir)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [150]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [156]
                )
              ]
            )
            (command.Sentence child:(C {<shift>}) terminator:<Id.Op_Semi _>)
            (command.Sentence child:(C {<shift>}) terminator:<Id.Op_Semi _>)
            (command.Subshell
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                  children: [
                    (C {<cd>} {(DQ ($ Id.VSub_DollarName '$subdir'))})
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-gt>} {<0>} 
                                  {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<git>} {<svn>} {<propset>} {(DQ ($ Id.VSub_Number '$1'))} 
                                  {(DQ ($ Id.VSub_Number '$2'))} {(DQ ($ Id.VSub_DollarName '$file'))}
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Exit exit>
                                  arg_word: {<1>}
                                )
                              ]
                            )
                            (command.Sentence
                              child: (C {<shift>})
                              terminator: <Id.Op_Semi _>
                            )
                            (command.Sentence
                              child: (C {<shift>})
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                    )
                    (command.Simple
                      words: [{<echo>} {<hello>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ ($ Id.VSub_DollarName '$file'))}
                        )
                      ]
                      do_fork: T
                    )
                    (C {<git>} {<commit>} {<-m>} {(DQ <'testing propset'>)} 
                      {(DQ ($ Id.VSub_DollarName '$file'))}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: confirm_props
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:subdir)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [270]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [276]
                )
              ]
            )
            (command.Sentence child:(C {<shift>}) terminator:<Id.Op_Semi _>)
            (command.Sentence child:(C {<shift>}) terminator:<Id.Op_Semi _>)
            (command.Subshell
              child: 
                (command.CommandList
                  children: [
                    (command.Sentence
                      child: (C {<set>} {<-e>})
                      terminator: <Id.Op_Semi _>
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<cd>} {(DQ <'svn_project/'> ($ Id.VSub_DollarName '$subdir'))})
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-gt>} {<0>} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (C {<test>} 
                                      {
                                        (DQ 
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: 
                                              (C {<svn_cmd>} {<propget>} {(DQ ($ Id.VSub_Number '$1'))} 
                                                {(DQ ($ Id.VSub_DollarName '$file'))}
                                              )
                                          )
                                        )
                                      } {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_Number '$2'))}
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Exit exit>
                                      arg_word: {<1>}
                                    )
                                  ]
                                )
                                (command.Sentence
                                  child: (C {<shift>})
                                  terminator: <Id.Op_Semi _>
                                )
                                (command.Sentence
                                  child: (C {<shift>})
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'add props top level'>)} 
      {
        (SQ <'\n'> <'\tset_props "." "foo" "svn:keywords" "FreeBSD=%H" &&\n'> 
          <'\tgit svn dcommit &&\n'> <'\tsvn_cmd co "$svnrepo" svn_project &&\n'> 
          <'\tconfirm_props "." "foo" "svn:keywords" "FreeBSD=%H" &&\n'> <'\trm -rf svn_project\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'add multiple props'>)} 
      {
        (SQ <'\n'> <'\tset_props "." "foo" \\\n'> 
          <'\t\t"svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&\n'> <'\tgit svn dcommit &&\n'> <'\tsvn_cmd co "$svnrepo" svn_project &&\n'> 
          <'\tconfirm_props "." "foo" \\\n'> <'\t\t"svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&\n'> <'\trm -rf svn_project\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'add props subdir'>)} 
      {
        (SQ <'\n'> <'\tset_props "." "$foo_subdir2" svn:keywords "FreeBSD=%H" &&\n'> 
          <'\tgit svn dcommit &&\n'> <'\tsvn_cmd co "$svnrepo" svn_project &&\n'> 
          <'\tconfirm_props "." "$foo_subdir2" "svn:keywords" "FreeBSD=%H" &&\n'> <'\trm -rf svn_project\n'> <'\t'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'add props relative'>)} 
      {
        (SQ <'\n'> <'\tset_props "subdir/subdir2" "../foo_subdir" \\\n'> 
          <'\t\tsvn:keywords "FreeBSD=%H" &&\n'> <'\tgit svn dcommit &&\n'> <'\tsvn_cmd co "$svnrepo" svn_project &&\n'> 
          <'\tconfirm_props "subdir/subdir2" "../foo_subdir" \\\n'> <'\t\tsvn:keywords "FreeBSD=%H" &&\n'> <'\trm -rf svn_project\n'> <'\t'>
        )
      }
    )
    (C {<test_done>})
  ]
)