commit | 583ca660913fca3f0c02aa7f94b75ddfaa31201e | [log] [tgz] |
---|---|---|
author | Joanna Wang <jojwang@google.com> | Wed Apr 27 21:17:17 2022 +0000 |
committer | LUCI CQ <infra-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Apr 27 21:17:17 2022 +0000 |
tree | 58cf17c12ac64ea7cb673510d1a9b9f6227ac7fa | |
parent | 41c57603f9f598bf0e3fe50989dde5ba426532e1 [diff] [blame] |
[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'.