[depot_tools] Give user option to clear cl issue for merged changes.

Test:
Merged: https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/3600858

Created new CL in same branch:
https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/3609588

Bug: 1312511

Change-Id: I20ccfc978fd84c4c68f71007cf636fc1ee8e3d4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3609115
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 1e2f675..627f03e 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1754,10 +1754,19 @@
       return
 
     status = self._GetChangeDetail()['status']
-    if status in ('MERGED', 'ABANDONED'):
-      DieWithError('Change %s has been %s, new uploads are not allowed' %
-                   (self.GetIssueURL(),
-                    'submitted' if status == 'MERGED' else 'abandoned'))
+    if status == 'ABANDONED':
+       DieWithError(
+           'Change %s has been abandoned, new uploads are not allowed' %
+           (self.GetIssueURL()))
+    if status == 'MERGED':
+      answer = gclient_utils.AskForData(
+          'Change %s has been submitted, new uploads are not allowed. '
+          'Would you like to start a new change (Y/n)?' % self.GetIssueURL()
+      ).lower()
+      if answer not in ('y', ''):
+        DieWithError('New uploads are not allowed.')
+      self.SetIssue()
+      return
 
     # TODO(vadimsh): For some reason the chunk of code below was skipped if
     # 'is_gce' is True. I'm just refactoring it to be 'skip if not cookies'.