summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorAnthony Newnam <anthony.newnam@garmin.com>2010-04-08 10:28:59 -0500
committerShawn O. Pearce <sop@google.com>2010-07-15 16:43:58 -0700
commitcc50bac8c7706082596d70756249d4964a67f281 (patch)
treebb87e8d8c128737710db6f00b35327ef28750c5b /subcmds/upload.py
parent0cb1b3f687da4634e431953ef84fee59dd3f5d59 (diff)
downloadgit-repo-cc50bac8c7706082596d70756249d4964a67f281.tar.gz
Warn users before uploading if there are local changes
Change-Id: I231d7b6a3211e9f5ec71a542a0109b0c195d5e40 Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r--subcmds/upload.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index ba532461..5a426113 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -320,6 +320,21 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
320 people = copy.deepcopy(original_people) 320 people = copy.deepcopy(original_people)
321 self._AppendAutoCcList(branch, people) 321 self._AppendAutoCcList(branch, people)
322 322
323 # Check if there are local changes that may have been forgotten
324 if branch.project.HasChanges():
325 key = 'review.%s.autoupload' % branch.project.remote.review
326 answer = branch.project.config.GetBoolean(key)
327
328 # if they want to auto upload, let's not ask because it could be automated
329 if answer is None:
330 sys.stdout.write('Uncommitted changes in ' + branch.project.name + ' (did you forget to amend?). Continue uploading? (y/n) ')
331 a = sys.stdin.readline().strip().lower()
332 if a not in ('y', 'yes', 't', 'true', 'on'):
333 print >>sys.stderr, "skipping upload"
334 branch.uploaded = False
335 branch.error = 'User aborted'
336 continue
337
323 branch.UploadForReview(people) 338 branch.UploadForReview(people)
324 branch.uploaded = True 339 branch.uploaded = True
325 except UploadError, e: 340 except UploadError, e: