diff options
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 7f7585ae..526dcd57 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -422,7 +422,16 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
422 | for project in project_list: | 422 | for project in project_list: |
423 | if opt.current_branch: | 423 | if opt.current_branch: |
424 | cbr = project.CurrentBranch | 424 | cbr = project.CurrentBranch |
425 | avail = [project.GetUploadableBranch(cbr)] if cbr else None | 425 | up_branch = project.GetUploadableBranch(cbr) |
426 | if up_branch: | ||
427 | avail = [up_branch] | ||
428 | else: | ||
429 | avail = None | ||
430 | print('ERROR: Current branch (%s) not uploadable. ' | ||
431 | 'You may be able to type ' | ||
432 | '"git branch --set-upstream-to m/master" to fix ' | ||
433 | 'your branch.' % str(cbr), | ||
434 | file=sys.stderr) | ||
426 | else: | 435 | else: |
427 | avail = project.GetUploadableBranches(branch) | 436 | avail = project.GetUploadableBranches(branch) |
428 | if avail: | 437 | if avail: |
@@ -432,8 +441,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
432 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, | 441 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, |
433 | self.manifest.topdir, abort_if_user_denies=True) | 442 | self.manifest.topdir, abort_if_user_denies=True) |
434 | pending_proj_names = [project.name for (project, avail) in pending] | 443 | pending_proj_names = [project.name for (project, avail) in pending] |
444 | pending_worktrees = [project.worktree for (project, avail) in pending] | ||
435 | try: | 445 | try: |
436 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names) | 446 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, |
447 | worktree_list=pending_worktrees) | ||
437 | except HookError as e: | 448 | except HookError as e: |
438 | print("ERROR: %s" % str(e), file=sys.stderr) | 449 | print("ERROR: %s" % str(e), file=sys.stderr) |
439 | return | 450 | return |