Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: git_cl.py

Issue 12646011: Warn when git cl upload might be overwriting a newer patchset. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: change < to != Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 869154cdc219e00444f941ee483f24a8317f312e..f836a0501f82119c3fccae9cab94b3b587efe55e 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698