(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <"git p4 fetching changes in multiple blocks">)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./lib-git-p4.sh)})
    (C {(test_expect_success)} {(SQ <"start p4d">)} {(SQ <"\n"> <"\tstart_p4d\n">)})
    (FuncDef
      name: create_restricted_group
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(p4)} {(group)} {(-i)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLessDash
                  fd: -1
                  body: 
                    {
                      (DQ ("Group: restricted\n") ("MaxResults: 7\n") ("MaxScanRows: 40\n") 
                        ("Users: author\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [40]
                )
              ]
            )
          ]
          spids: [31]
        )
      spids: [27 30]
    )
    (C {(test_expect_success)} {(SQ <"Create group with limited maxrows">)} 
      {(SQ <"\n"> <"\tcreate_restricted_group\n">)}
    )
    (C {(test_expect_success)} {(SQ <"Create a repo with many changes">)} 
      {
        (SQ <"\n"> <"\t(\n"> <"\t\tclient_view \"//depot/included/... //client/included/...\" \\\n"> 
          <"\t\t\t    \"//depot/excluded/... //client/excluded/...\" &&\n"> <"\t\tmkdir -p \"$cli/included\" \"$cli/excluded\" &&\n"> <"\t\tcd \"$cli/included\" &&\n"> 
          <"\t\t>file.txt &&\n"> <"\t\tp4 add file.txt &&\n"> <"\t\tp4 submit -d \"Add file.txt\" &&\n"> 
          <"\t\tfor i in $(test_seq 0 5)\n"> <"\t\tdo\n"> <"\t\t\t>outer$i.txt &&\n"> <"\t\t\tp4 add outer$i.txt &&\n"> 
          <"\t\t\tp4 submit -d \"Adding outer$i.txt\" &&\n"> <"\t\t\tfor j in $(test_seq 0 5)\n"> <"\t\t\tdo\n"> <"\t\t\t\tp4 edit file.txt &&\n"> 
          <"\t\t\t\techo $i$j >file.txt &&\n"> <"\t\t\t\tp4 submit -d \"Commit $i$j\" || exit\n"> <"\t\t\tdone || exit\n"> <"\t\tdone\n"> <"\t)\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"Default user cannot fetch changes">)} 
      {(SQ <"\n"> <"\t! p4 changes -m 1 //depot/...\n">)}
    )
    (C {(test_expect_success)} {(SQ <"Clone the repo">)} 
      {
        (SQ <"\n"> 
          <
"\tgit p4 clone --dest=\"$git\" --changes-block-size=7 --verbose //depot/included@all\n"
          >
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"All files are present">)} 
      {
        (SQ <"\n"> <"\techo file.txt >expected &&\n"> 
          <
"\ttest_write_lines outer0.txt outer1.txt outer2.txt outer3.txt outer4.txt >>expected &&\n"
          > <"\ttest_write_lines outer5.txt >>expected &&\n"> <"\tls \"$git\" >current &&\n"> 
          <"\ttest_cmp expected current\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"file.txt is correct">)} 
      {(SQ <"\n"> <"\techo 55 >expected &&\n"> <"\ttest_cmp expected \"$git/file.txt\"\n">)}
    )
    (C {(test_expect_success)} {(SQ <"Correct number of commits">)} 
      {
        (SQ <"\n"> <"\t(cd \"$git\" && git log --oneline) >log &&\n"> <"\twc -l log &&\n"> 
          <"\ttest_line_count = 43 log\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"Previous version of file.txt is correct">)} 
      {
        (SQ <"\n"> <"\t(cd \"$git\" && git checkout HEAD^^) &&\n"> <"\techo 53 >expected &&\n"> 
          <"\ttest_cmp expected \"$git/file.txt\"\n">
        )
      }
    )
    (FuncDef
      name: p4_add_file
      body: 
        (BraceGroup
          children: [
            (Subshell
              child: 
                (AndOr
                  children: [
                    (C {(cd)} {(DQ ($ VSub_Name "$cli"))})
                    (AndOr
                      children: [
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {($ VSub_Number "$1")}
                              spids: [196]
                            )
                          ]
                        )
                        (AndOr
                          children: [
                            (C {(p4)} {(add)} {($ VSub_Number "$1")})
                            (C {(p4)} {(submit)} {(-d)} {(DQ ("Added file ") ($ VSub_Number "$1"))} 
                              {($ VSub_Number "$1")}
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              spids: [186 225]
            )
          ]
          spids: [183]
        )
      spids: [179 182]
    )
    (C {(test_expect_success)} {(SQ <"Add some more files">)} 
      {
        (SQ <"\n"> <"\tfor i in $(test_seq 0 10)\n"> <"\tdo\n"> 
          <"\t\tp4_add_file \"included/x$i\" &&\n"> <"\t\tp4_add_file \"excluded/x$i\"\n"> <"\tdone &&\n"> <"\tfor i in $(test_seq 0 10)\n"> <"\tdo\n"> 
          <"\t\tp4_add_file \"excluded/y$i\"\n"> <"\tdone\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"Syncing files">)} 
      {
        (SQ <"\n"> <"\t(\n"> <"\t\tcd \"$git\" &&\n"> <"\t\tgit p4 sync --changes-block-size=7 &&\n"> 
          <"\t\tgit checkout p4/master &&\n"> <"\t\tls -l x* > log &&\n"> <"\t\ttest_line_count = 11 log\n"> <"\t)\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"Create a repo with multiple depot paths">)} 
      {
        (SQ <"\n"> <"\tclient_view \"//depot/pathA/... //client/pathA/...\" \\\n"> 
          <"\t\t    \"//depot/pathB/... //client/pathB/...\" &&\n"> <"\tmkdir -p \"$cli/pathA\" \"$cli/pathB\" &&\n"> <"\tfor p in pathA pathB\n"> <"\tdo\n"> 
          <"\t\tfor i in $(test_seq 1 10)\n"> <"\t\tdo\n"> <"\t\t\tp4_add_file \"$p/file$p$i\"\n"> <"\t\tdone\n"> <"\tdone\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"Clone repo with multiple depot paths">)} 
      {
        (SQ <"\n"> <"\t(\n"> <"\t\tcd \"$git\" &&\n"> 
          <"\t\tgit p4 clone --changes-block-size=4 //depot/pathA@all //depot/pathB@all \\\n"> <"\t\t\t--destination=dest &&\n"> <"\t\tls -1 dest >log &&\n"> <"\t\ttest_line_count = 20 log\n"> 
          <"\t)\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"kill p4d">)} {(SQ <"\n"> <"\tkill_p4d\n">)})
    (C {(test_done)})
  ]
)