Support --enable-auto-submit in `git cl split`

With default True.

This CL was uploaded by git cl split.

R=jochen@chromium.org
Bug: 927178
Change-Id: Ie0a68ed7ca381e1bb33341badca153bf409bb376
Reviewed-on: https://chromium-review.googlesource.com/c/1470402
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
diff --git a/split_cl.py b/split_cl.py
index e501329..1e93975 100644
--- a/split_cl.py
+++ b/split_cl.py
@@ -75,7 +75,7 @@
 
 def UploadCl(refactor_branch, refactor_branch_upstream, directory, files,
              description, comment, reviewers, changelist, cmd_upload,
-             cq_dry_run):
+             cq_dry_run, enable_auto_submit):
   """Uploads a CL with all changes to |files| in |refactor_branch|.
 
   Args:
@@ -90,6 +90,7 @@
     changelist: The Changelist class.
     cmd_upload: The function associated with the git cl upload command.
     cq_dry_run: If CL uploads should also do a cq dry run.
+    enable_auto_submit: If CL uploads should also enable auto submit.
   """
   # Create a branch.
   if not CreateBranchForDirectory(
@@ -121,6 +122,8 @@
     upload_args.append('--cq-dry-run')
   if not comment:
     upload_args.append('--send-mail')
+  if enable_auto_submit:
+    upload_args.append('--enable-auto-submit')
   print 'Uploading CL for ' + directory + '.'
   cmd_upload(upload_args)
   if comment:
@@ -168,7 +171,7 @@
 
 
 def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
-            cq_dry_run):
+            cq_dry_run, enable_auto_submit):
   """"Splits a branch into smaller branches and uploads CLs.
 
   Args:
@@ -178,6 +181,7 @@
     cmd_upload: The function associated with the git cl upload command.
     dry_run: Whether this is a dry run (no branches or CLs created).
     cq_dry_run: If CL uploads should also do a cq dry run.
+    enable_auto_submit: If CL uploads should also enable auto submit.
 
   Returns:
     0 in case of success. 1 in case of error.
@@ -236,7 +240,7 @@
       else:
         UploadCl(refactor_branch, refactor_branch_upstream, directory, files,
                  description, comment, reviewers, changelist, cmd_upload,
-                 cq_dry_run)
+                 cq_dry_run, enable_auto_submit)
 
     # Go back to the original branch.
     git.run('checkout', refactor_branch)