diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-23 09:50:56 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-23 09:50:56 -0500 |
commit | 510c9f33393c1f222ee56732c026f229ed8ae49d (patch) | |
tree | ba51973a3fd3eb5893d413f6c8b5a721867d26dc /becommands/comment.py | |
parent | 333fc7968794deff9aa7a7a91d72cf17763df855 (diff) | |
download | bugseverywhere-510c9f33393c1f222ee56732c026f229ed8ae49d.tar.gz |
Go back to lazy bug loading to get execution speed back up.
Fixes bug b3c6da51-3a30-42c9-8c75-587c7a1705c5
Diffstat (limited to 'becommands/comment.py')
-rw-r--r-- | becommands/comment.py | 18 |
1 files changed, 12 insertions, 6 deletions
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: |