add more default=True

This commit is contained in:
Benjamin Dauvergne 2019-08-06 17:01:04 +02:00
parent a0597039ec
commit 3ed6983474
1 changed files with 7 additions and 6 deletions

View File

@ -221,7 +221,7 @@ def take(issue_number, reference):
click.echo('Moved to branch %s' % branch_name)
current_user = api.user.get('current')
if ((not hasattr(issue, 'assigned_to') or issue.assigned_to.id != current_user.id)
and click.confirm('Do you want to assign the issue to yourself ?')):
and click.confirm('Do you want to assign the issue to yourself ?', default=True)):
issue.assigned_to_id = current_user.id
issue.save()
if new:
@ -281,7 +281,7 @@ def submit(ctx, issue, number_of_commits):
click.echo(click.style(u'Push from « %s » to « %s » failed.' % (
pi.local_ref.name, pi.remote_ref.name, pi.summary), fg='red'))
if click.confirm('Propose this patch as a solution ?'):
if click.confirm('Propose this patch as a solution ?', default=True):
current_user = api.user.get('current')
if not hasattr(issue, 'assigned_to'):
issue.assigned_to_id = current_user.id
@ -324,7 +324,7 @@ def new(ctx):
click.echo('Subject: %s' % subject)
click.echo('Description: %s' % description)
click.echo('Assigned to: %s' % current_user)
if click.confirm('Create issue ?'):
if click.confirm('Create issue ?', default=True):
issue = api.issue.create(
project_id=project.id,
subject=subject,
@ -436,17 +436,18 @@ def merge_and_push(issue, target_branch):
pass
else:
if click.confirm(u'Do you want to delete feature branch « %s » on remote « %s » ?' % (
current_head, origin.name)):
current_head, origin.name), default=True):
for pi in origin.push(refspec=':%s' % current_head):
if pi.flags & pi.ERROR:
click.echo(click.style(u'Push from « %s » to « %s » failed.' % (
pi.local_ref.name, pi.remote_ref.name, pi.summary), fg='red'))
if click.confirm(u'Do you want to push « %s » on remote « %s » ?' % (target_branch, repo.remote().name)):
if click.confirm(u'Do you want to push « %s » on remote « %s » ?' % (target_branch, repo.remote().name),
default=True):
for pi in origin.push():
if pi.flags & pi.ERROR:
click.echo(click.style(u'Push from « %s » to « %s » failed: %s.' % (
pi.local_ref.name, pi.remote_ref.name, pi.summary), fg='red'))
if click.confirm(u'Do you want to delete feature branch « %s » ?' % current_head):
if click.confirm(u'Do you want to delete feature branch « %s » ?' % current_head, default=True):
repo.delete_head(repo.branches[current_head])
else:
repo.branches[current_head].checkout()