aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/open.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-24 18:29:16 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-24 18:29:16 -0500
commita711ecf10df62e30d83c1941065404c53fecd35b (patch)
tree4111ef606fa52dc7f21ca3eb357ff83fae74fe1e /becommands/open.py
parentc5d7551e6a6e98bb6da7c7d11360224edfda2f14 (diff)
parent2c3f6c066ceb03ae3579dff029bf01f0b62c1f82 (diff)
downloadbugseverywhere-a711ecf10df62e30d83c1941065404c53fecd35b.tar.gz
Merge from W. Trevor King's tree.
Diffstat (limited to 'becommands/open.py')
-rw-r--r--becommands/open.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/becommands/open.py b/becommands/open.py
index f7c23c1..788a183 100644
--- a/becommands/open.py
+++ b/becommands/open.py
@@ -15,26 +15,31 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Re-open a bug"""
-from libbe import cmdutil
+from libbe import cmdutil, bugdir
+__desc__ = __doc__
+
def execute(args):
"""
- >>> from libbe import tests
>>> import os
- >>> dir = tests.simple_bug_dir()
- >>> os.chdir(dir.dir)
- >>> dir.get_bug("b").status
- u'closed'
+ >>> bd = bugdir.simple_bug_dir()
+ >>> os.chdir(bd.root)
+ >>> print bd.bug_from_shortname("b").status
+ closed
>>> execute(["b"])
- >>> dir.get_bug("b").status
- u'open'
- >>> tests.clean_up()
+ >>> bd._clear_bugs()
+ >>> print bd.bug_from_shortname("b").status
+ open
"""
options, args = get_parser().parse_args(args)
- if len(args) !=1:
+ if len(args) == 0:
raise cmdutil.UserError("Please specify a bug id.")
- bug = cmdutil.get_bug(args[0])
+ if len(args) > 1:
+ help()
+ raise cmdutil.UserError("Too many arguments.")
+ bd = bugdir.BugDir(from_disk=True)
+ bug = bd.bug_from_shortname(args[0])
bug.status = "open"
- bug.save()
+ bd.save()
def get_parser():
parser = cmdutil.CmdOptionParser("be open BUG-ID")