Chromium Code Reviews

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: respond to comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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 2fd5d852f15d892dc6ae968fbd2ceee33cdb4666..fbb327338b2fc6884ca1b2e1a53446fac057ce9f 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1285,6 +1285,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:
M-A Ruel 2013/03/19 01:26:45 The problem here is that you are comparing patchse
koz (OOO until 15th September) 2013/03/19 01:29:16 Oh, they aren't? What if we change '<' to '!=' the
M-A Ruel 2013/04/02 20:08:54 Yes please do.
koz (OOO until 15th September) 2013/04/02 20:40:04 Done.
+ 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