aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/new.py
blob: afa6494fe12f2ad3744ed45283940d0821737b7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
"""Create a new bug"""
from libbe import bugdir, cmdutil, names, utility
def execute(args):
    if len(args) != 1:
        raise cmdutil.UserError("Please supply a summary message")
    dir = cmdutil.bug_tree()
    bug = bugdir.new_bug(dir)
    bug.summary = args[0]
    bug.save()
    bugs = (dir.list())
    print "Created bug with ID %s" % cmdutil.unique_name(bug, bugs)