summaryrefslogtreecommitdiffstats
path: root/llvm/utils/git-svn/git-llvm
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-08-21 16:03:34 +0000
committerNico Weber <nicolasweber@gmx.de>2019-08-21 16:03:34 +0000
commitf3b179589ed8142fb4ec92789e249360cc3cf49e (patch)
tree1dacd934a41add264b8e6337a86748d8ea37c3e8 /llvm/utils/git-svn/git-llvm
parentf7489141be5df992e569886caad22b7d9d5dde35 (diff)
downloadbcm5719-llvm-f3b179589ed8142fb4ec92789e249360cc3cf49e.tar.gz
bcm5719-llvm-f3b179589ed8142fb4ec92789e249360cc3cf49e.zip
git-llvm: Make push --force suppress error on nothing to commit as well
llvm-svn: 369544
Diffstat (limited to 'llvm/utils/git-svn/git-llvm')
-rwxr-xr-xllvm/utils/git-svn/git-llvm11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm
index e30d17c78a1..549a45558dd 100755
--- a/llvm/utils/git-svn/git-llvm
+++ b/llvm/utils/git-svn/git-llvm
@@ -209,11 +209,8 @@ def get_revs_to_push(rev_range):
# Use git show rather than some plumbing command to figure out which revs
# are in rev_range because it handles single revs (HEAD^) and ranges
# (foo..bar) like we want.
- revs = git('show', '--reverse', '--quiet',
+ return git('show', '--reverse', '--quiet',
'--pretty=%h', rev_range).splitlines()
- if not revs:
- die('Nothing to push: No revs in range %s.' % rev_range)
- return revs
def clean_svn(svn_repo):
@@ -462,6 +459,10 @@ def cmd_push(args):
rev_range = args.rev_range
dry_run = args.dry_run
revs = get_revs_to_push(rev_range)
+
+ if not args.force and not revs:
+ die('Nothing to push: No revs in range %s.' % rev_range)
+
log('%sPushing %d %s commit%s:\n%s' %
('[DryRun] ' if dry_run else '', len(revs),
'split-repo (%s)' % split_repo_path
@@ -471,7 +472,7 @@ def cmd_push(args):
for c in revs)))
# Ask confirmation if multiple commits are about to be pushed
- if not args.force and len(revs) != 1:
+ if not args.force and len(revs) > 1:
if not ask_confirm("Are you sure you want to create %d commits?" % len(revs)):
die("Aborting")
OpenPOWER on IntegriCloud