From 5974d7a5f23f07b81016e16648f9b044c7340fc3 Mon Sep 17 00:00:00 2001 From: "koz@chromium.org" Date: Tue, 2 Apr 2013 20:50:37 +0000 Subject: [PATCH] Warn when git cl upload might be overwriting a newer patchset. Review URL: https://chromiumcodereview.appspot.com/12646011 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@191895 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/git_cl.py b/git_cl.py index 869154cdc..f836a0501 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1290,6 +1290,15 @@ def CMDupload(parser, args): if not options.reviewers and hook_results.reviewers: options.reviewers = hook_results.reviewers + if cl.GetIssue(): + latest_patchset = cl.GetMostRecentPatchset(cl.GetIssue()) + local_patchset = cl.GetPatchset() + if local_patchset != latest_patchset: + print ('The last upload made from this repository was patchset #%d but ' + 'the most recent patchset on the server is #%d.' + % (local_patchset, latest_patchset)) + ask_for_data('About to upload; enter to confirm.') + print_stats(options.similarity, options.find_copies, args) if settings.GetIsGerrit(): return GerritUpload(options, args, cl)