Added new status - "in-progress"
authorOleg Romanyshyn <oromanyshyn@panoramicfeedback.com>
Fri, 22 Apr 2005 15:44:12 +0000 (15:44 +0000)
committerOleg Romanyshyn <oromanyshyn@panoramicfeedback.com>
Fri, 22 Apr 2005 15:44:12 +0000 (15:44 +0000)
be
becommands/inprogress.py [new file with mode: 0644]
libbe/bugdir.py

diff --git a/be b/be
index 63417295233a61e11e0bb75162a6c87862212836..b7ca7263723a671239e7df4ac751eb6292549f20 100755 (executable)
--- a/be
+++ b/be
@@ -11,6 +11,7 @@ import becommands.set_root
 import becommands.new
 import becommands.close
 import becommands.open
+import becommands.inprogress
 __doc__ = """Bugs Everywhere - Distributed bug tracking
 
 Supported becommands
diff --git a/becommands/inprogress.py b/becommands/inprogress.py
new file mode 100644 (file)
index 0000000..968551e
--- /dev/null
@@ -0,0 +1,19 @@
+"""Close a bug"""
+from libbe import cmdutil
+def execute(args):
+    """
+    >>> from libbe import tests
+    >>> import os
+    >>> dir = tests.simple_bug_dir()
+    >>> os.chdir(dir.dir)
+    >>> dir.get_bug("a").status
+    'open'
+    >>> execute(("a",))
+    >>> dir.get_bug("a").status
+    'in-progress'
+    >>> tests.clean_up()
+    """
+    assert(len(args) == 1)
+    bug = cmdutil.get_bug(args[0])
+    bug.status = "in-progress"
+    bug.save()
index 16c1544746e2b5b71bcdc55f3dc4b1951db4e524..7c02ff33081a87915c1cff81e118e1a3109d3da3 100644 (file)
@@ -148,7 +148,7 @@ for i in range(len(severity_levels)):
     severity_value[severity_levels[i]] = i
 
 class Bug(object):
-    status = checked_property("status", (None, "open", "closed"))
+    status = checked_property("status", (None, "open", "closed", "in-progress"))
     severity = checked_property("severity", (None, "wishlist", "minor",
                                              "serious", "critical", "fatal"))
 
@@ -176,7 +176,7 @@ class Bug(object):
         return os.path.join(self.path, self.uuid, file)
 
     def _get_active(self):
-        return self.status == "open"
+        return self.status in ("open", "in-progress")
 
     active = property(_get_active)