diff options
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/assign.py | 12 | ||||
-rw-r--r-- | becommands/close.py | 4 | ||||
-rw-r--r-- | becommands/comment.py | 18 | ||||
-rw-r--r-- | becommands/diff.py | 2 | ||||
-rw-r--r-- | becommands/list.py | 5 | ||||
-rw-r--r-- | becommands/new.py | 2 | ||||
-rw-r--r-- | becommands/open.py | 4 | ||||
-rw-r--r-- | becommands/remove.py | 4 | ||||
-rw-r--r-- | becommands/set.py | 2 | ||||
-rw-r--r-- | becommands/set_root.py | 2 | ||||
-rw-r--r-- | becommands/severity.py | 2 | ||||
-rw-r--r-- | becommands/show.py | 2 | ||||
-rw-r--r-- | becommands/status.py | 2 | ||||
-rw-r--r-- | becommands/target.py | 2 |
14 files changed, 35 insertions, 28 deletions
diff --git a/becommands/assign.py b/becommands/assign.py index 2cdcf4c..b01c66a 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -27,17 +27,17 @@ def execute(args): True >>> execute(["a"]) - >>> bd.load() - >>> bd.bug_from_shortname("a").assigned == bd.rcs.get_user_id() + >>> bd._clear_bugs() + >>> bd.bug_from_shortname("a").assigned == bd.user_id True >>> execute(["a", "someone"]) - >>> bd.load() + >>> bd._clear_bugs() >>> print bd.bug_from_shortname("a").assigned someone >>> execute(["a","none"]) - >>> bd.load() + >>> bd._clear_bugs() >>> bd.bug_from_shortname("a").assigned is None True """ @@ -48,10 +48,10 @@ def execute(args): if len(args) > 2: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) if len(args) == 1: - bug.assigned = bug.rcs.get_user_id() + bug.assigned = bd.user_id elif len(args) == 2: if args[1] == "none": bug.assigned = None diff --git a/becommands/close.py b/becommands/close.py index 38a5613..67813f7 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -27,7 +27,7 @@ def execute(args): >>> print bd.bug_from_shortname("a").status open >>> execute(["a"]) - >>> bd.load() + >>> bd._clear_bugs() >>> print bd.bug_from_shortname("a").status closed """ @@ -37,7 +37,7 @@ def execute(args): if len(args) > 1: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) bug.status = "closed" bd.save() diff --git a/becommands/comment.py b/becommands/comment.py index 045b331..172f818 100644 --- a/becommands/comment.py +++ b/becommands/comment.py @@ -25,12 +25,14 @@ def execute(args): >>> bd = bugdir.simple_bug_dir() >>> os.chdir(bd.root) >>> execute(["a", "This is a comment about a"]) - >>> bd.load() - >>> comment = bd.bug_from_shortname("a").comment_root[0] + >>> bd._clear_bugs() + >>> bug = bd.bug_from_shortname("a") + >>> bug.load_comments() + >>> comment = bug.comment_root[0] >>> print comment.body This is a comment about a <BLANKLINE> - >>> comment.From == bd.rcs.get_user_id() + >>> comment.From == bd.user_id True >>> comment.time <= int(time.time()) True @@ -45,8 +47,11 @@ def execute(args): >>> os.environ["EDITOR"] = "echo 'I like cheese' > " >>> execute(["b"]) - >>> bd.load() - >>> print bd.bug_from_shortname("b").comment_root[0].body + >>> bd._clear_bugs() + >>> bug = bd.bug_from_shortname("b") + >>> bug.load_comments() + >>> comment = bug.comment_root[0] + >>> print comment.body I like cheese <BLANKLINE> """ @@ -68,8 +73,9 @@ def execute(args): bugname = shortname is_reply = False - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(bugname) + bug.load_comments() if is_reply: parent = bug.comment_root.comment_from_shortname(shortname, bug_shortname=bugname) else: diff --git a/becommands/diff.py b/becommands/diff.py index 9d8d3b5..0a3bab1 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -46,7 +46,7 @@ def execute(args): if len(args) > 1: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) if bd.rcs.versioned == False: print "This directory is not revision-controlled." else: diff --git a/becommands/list.py b/becommands/list.py index 22d73d9..63e1cd6 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -36,7 +36,8 @@ def execute(args): if len(args) > 0: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) + bd.load_all_bugs() # select status if options.status != None: if options.status == "all": @@ -84,7 +85,7 @@ def execute(args): assigned = "all" for i in range(len(assigned)): if assigned[i] == '-': - assigned[i] = bd.rcs.get_user_id() + assigned[i] = bd.user_id # select target if options.target != None: if options.target == "all": diff --git a/becommands/new.py b/becommands/new.py index c9688b9..caa1549 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -41,7 +41,7 @@ def execute(args): options, args = get_parser().parse_args(args) if len(args) != 1: raise cmdutil.UserError("Please supply a summary message") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.new_bug(summary=args[0]) bd.save() print "Created bug with ID %s" % bd.bug_shortname(bug) diff --git a/becommands/open.py b/becommands/open.py index 736b601..788a183 100644 --- a/becommands/open.py +++ b/becommands/open.py @@ -26,7 +26,7 @@ def execute(args): >>> print bd.bug_from_shortname("b").status closed >>> execute(["b"]) - >>> bd.load() + >>> bd._clear_bugs() >>> print bd.bug_from_shortname("b").status open """ @@ -36,7 +36,7 @@ def execute(args): if len(args) > 1: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) bug.status = "open" bd.save() diff --git a/becommands/remove.py b/becommands/remove.py index 7ba5e23..6fddb1f 100644 --- a/becommands/remove.py +++ b/becommands/remove.py @@ -28,7 +28,7 @@ def execute(args): closed >>> execute (["b"]) Removed bug b - >>> bd.load() + >>> bd._clear_bugs() >>> try: ... bd.bug_from_shortname("b") ... except KeyError: @@ -38,7 +38,7 @@ def execute(args): options, args = get_parser().parse_args(args) if len(args) != 1: raise cmdutil.UserError("Please specify a bug id.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) bd.remove_bug(bug) bd.save() diff --git a/becommands/set.py b/becommands/set.py index 7951c8b..d556ea6 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -36,7 +36,7 @@ def execute(args): if len(args) > 2: help() raise cmdutil.UserError("Too many arguments.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) if len(args) == 0: keys = bd.settings.keys() keys.sort() diff --git a/becommands/set_root.py b/becommands/set_root.py index a2d2d95..9fb48cb 100644 --- a/becommands/set_root.py +++ b/becommands/set_root.py @@ -67,7 +67,7 @@ def execute(args): pass #raise cmdutil.UserError, "No such directory: %s" % basedir try: - bd = bugdir.BugDir(basedir, loadNow=False, sink_to_existing_root=False, assert_new_BugDir=True) + bd = bugdir.BugDir(basedir, from_disk=False, sink_to_existing_root=False, assert_new_BugDir=True) except bugdir.NoRootEntry: raise cmdutil.UserError("No such directory: %s" % basedir) except bugdir.AlreadyInitialized: diff --git a/becommands/severity.py b/becommands/severity.py index d7df13d..3f25445 100644 --- a/becommands/severity.py +++ b/becommands/severity.py @@ -37,7 +37,7 @@ def execute(args): if len(args) not in (1,2): print help() return - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) if len(args) == 1: print bug.severity diff --git a/becommands/show.py b/becommands/show.py index a2cd322..9e4e647 100644 --- a/becommands/show.py +++ b/becommands/show.py @@ -38,7 +38,7 @@ def execute(args): options, args = get_parser().parse_args(args) if len(args) == 0: raise cmdutil.UserError("Please specify a bug id.") - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) for bugid in args: bug = bd.bug_from_shortname(bugid) print bug.string(show_comments=True) diff --git a/becommands/status.py b/becommands/status.py index de171f5..3dfd548 100644 --- a/becommands/status.py +++ b/becommands/status.py @@ -37,7 +37,7 @@ def execute(args): if len(args) not in (1,2): print help() return - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) if len(args) == 1: print bug.status diff --git a/becommands/target.py b/becommands/target.py index 2047397..3ca7710 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -37,7 +37,7 @@ def execute(args): if len(args) == 0: print help() return - bd = bugdir.BugDir(loadNow=True) + bd = bugdir.BugDir(from_disk=True) bug = bd.bug_from_shortname(args[0]) if len(args) == 1: if bug.target is None: |