diff options
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index e2fa261e..674fc17d 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -25,10 +25,12 @@ from git_command import GitCommand | |||
25 | from project import RepoHook | 25 | from project import RepoHook |
26 | 26 | ||
27 | from pyversion import is_python3 | 27 | from pyversion import is_python3 |
28 | # pylint:disable=W0622 | ||
28 | if not is_python3(): | 29 | if not is_python3(): |
29 | # pylint:disable=W0622 | ||
30 | input = raw_input | 30 | input = raw_input |
31 | # pylint:enable=W0622 | 31 | else: |
32 | unicode = str | ||
33 | # pylint:enable=W0622 | ||
32 | 34 | ||
33 | UNUSUAL_COMMIT_THRESHOLD = 5 | 35 | UNUSUAL_COMMIT_THRESHOLD = 5 |
34 | 36 | ||
@@ -337,13 +339,17 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
337 | self._AppendAutoList(branch, people) | 339 | self._AppendAutoList(branch, people) |
338 | 340 | ||
339 | # Check if there are local changes that may have been forgotten | 341 | # Check if there are local changes that may have been forgotten |
340 | if branch.project.HasChanges(): | 342 | changes = branch.project.UncommitedFiles() |
343 | if changes: | ||
341 | key = 'review.%s.autoupload' % branch.project.remote.review | 344 | key = 'review.%s.autoupload' % branch.project.remote.review |
342 | answer = branch.project.config.GetBoolean(key) | 345 | answer = branch.project.config.GetBoolean(key) |
343 | 346 | ||
344 | # if they want to auto upload, let's not ask because it could be automated | 347 | # if they want to auto upload, let's not ask because it could be automated |
345 | if answer is None: | 348 | if answer is None: |
346 | sys.stdout.write('Uncommitted changes in ' + branch.project.name + ' (did you forget to amend?). Continue uploading? (y/N) ') | 349 | sys.stdout.write('Uncommitted changes in ' + branch.project.name) |
350 | sys.stdout.write(' (did you forget to amend?):\n') | ||
351 | sys.stdout.write('\n'.join(changes) + '\n') | ||
352 | sys.stdout.write('Continue uploading? (y/N) ') | ||
347 | a = sys.stdin.readline().strip().lower() | 353 | a = sys.stdin.readline().strip().lower() |
348 | if a not in ('y', 'yes', 't', 'true', 'on'): | 354 | if a not in ('y', 'yes', 't', 'true', 'on'): |
349 | print("skipping upload", file=sys.stderr) | 355 | print("skipping upload", file=sys.stderr) |