@cli.command()<EOL>@click.argument("<STR_LIT>", default="<STR_LIT>")<EOL>@pass_config<EOL>def start(config, bugnumber="<STR_LIT>"):
repo = config.repo<EOL>if bugnumber:<EOL><INDENT>summary, bugnumber, url = get_summary(config, bugnumber)<EOL><DEDENT>else:<EOL><INDENT>url = None<EOL>summary = None<EOL><DEDENT>if summary:<EOL><INDENT>summary = input('<STR_LIT>'.format(summary)).strip() or summary<EOL><DEDENT>else:<EOL><INDENT>summary = input("<STR_LIT>").strip()<EOL><DEDENT>branch_name = "<STR_LIT>"<EOL>if bugnumber:<EOL><INDENT>if is_github({"<STR_LIT>": bugnumber, "<STR_LIT:url>": url}):<EOL><INDENT>branch_name = "<STR_LIT>".format(bugnumber)<EOL><DEDENT>else:<EOL><INDENT>branch_name = "<STR_LIT>".format(bugnumber)<EOL><DEDENT><DEDENT>def clean_branch_name(string):<EOL><INDENT>string = re.sub(r"<STR_LIT>", "<STR_LIT:U+0020>", string)<EOL>string = string.replace("<STR_LIT:U+0020>", "<STR_LIT:->")<EOL>string = string.replace("<STR_LIT>", "<STR_LIT:->").replace("<STR_LIT>", "<STR_LIT:->")<EOL>for each in "<STR_LIT>":<EOL><INDENT>string = string.replace(each, "<STR_LIT>")<EOL><DEDENT>string = re.sub("<STR_LIT>", "<STR_LIT:->", string)<EOL>string = string.strip("<STR_LIT:->")<EOL>return string.lower().strip()<EOL><DEDENT>branch_name += clean_branch_name(summary)<EOL>if not branch_name:<EOL><INDENT>error_out("<STR_LIT>")<EOL><DEDENT>found = list(find(repo, branch_name, exact=True))<EOL>if found:<EOL><INDENT>error_out("<STR_LIT>".format(found[<NUM_LIT:0>].name))<EOL><DEDENT>new_branch = repo.create_head(branch_name)<EOL>new_branch.checkout()<EOL>if config.verbose:<EOL><INDENT>click.echo("<STR_LIT>".format(branch_name))<EOL><DEDENT>save(config.configfile, summary, branch_name, bugnumber=bugnumber, url=url)<EOL>
Create a new topic branch.