diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2014-10-05 15:40:30 -0700 |
---|---|---|
committer | Vadim Bendebury <vbendeb@google.com> | 2014-10-14 11:20:05 -0700 |
commit | 14e134da02f3c050c9a6ec31242b45e27bdf4821 (patch) | |
tree | f6c417df0dfbb5799a2406fbae206be64a0d3214 /subcmds/upload.py | |
parent | 5cf16607d33268ab0320a886c4a7b5e052684fa4 (diff) | |
download | git-repo-14e134da02f3c050c9a6ec31242b45e27bdf4821.tar.gz |
upload: report names of uncommitted files
When there are uncommitted files in the tree, 'repo upload' stops to
ask if it is OK to continue, but does not report the actual names of
uncommitted files.
This patch adds plumbing to have the outstanding file names reported
if desired.
BUG=None
TEST=verified that 'repo upload' properly operates with the following
conditions present in the tree:
. file(s) modified locally
. file(s) added to index, but not committed
. files not known to git
. no modified files (the upload proceeds as expected)
Change-Id: If65d5f8e8bcb3300c16d85dc5d7017758545f80d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 0ee36df1..674fc17d 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -339,13 +339,17 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
339 | self._AppendAutoList(branch, people) | 339 | self._AppendAutoList(branch, people) |
340 | 340 | ||
341 | # Check if there are local changes that may have been forgotten | 341 | # Check if there are local changes that may have been forgotten |
342 | if branch.project.HasChanges(): | 342 | changes = branch.project.UncommitedFiles() |
343 | if changes: | ||
343 | key = 'review.%s.autoupload' % branch.project.remote.review | 344 | key = 'review.%s.autoupload' % branch.project.remote.review |
344 | answer = branch.project.config.GetBoolean(key) | 345 | answer = branch.project.config.GetBoolean(key) |
345 | 346 | ||
346 | # 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 |
347 | if answer is None: | 348 | if answer is None: |
348 | 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) ') | ||
349 | a = sys.stdin.readline().strip().lower() | 353 | a = sys.stdin.readline().strip().lower() |
350 | if a not in ('y', 'yes', 't', 'true', 'on'): | 354 | if a not in ('y', 'yes', 't', 'true', 'on'): |
351 | print("skipping upload", file=sys.stderr) | 355 | print("skipping upload", file=sys.stderr) |