aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/diff.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-24 07:47:06 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-24 07:47:06 -0500
commit5fd5bc89a2ec270d3e0b01f583012eaaf7750693 (patch)
treebf8b9e1951086bdaf1de2523c2fd67fbe06b697e /libbe/diff.py
parentd248dbca39e1e8a26a5aa9d39b28038690a406a0 (diff)
downloadbugseverywhere-5fd5bc89a2ec270d3e0b01f583012eaaf7750693.tar.gz
Added Bug.comments(), BugDir.has_bug() & cleaned up diff.diff().
+ some other minor fixes and cleanups.
Diffstat (limited to 'libbe/diff.py')
-rw-r--r--libbe/diff.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/libbe/diff.py b/libbe/diff.py
index 84b3bfe..86a91ca 100644
--- a/libbe/diff.py
+++ b/libbe/diff.py
@@ -33,7 +33,7 @@ def diff(old_bugdir, new_bugdir):
except KeyError:
removed.append(old_bug)
for uuid in new_bugdir.list_uuids():
- if not old_bugdir.bug_map.has_key(uuid):
+ if not old_bugdir.has_bug(uuid):
new_bug = new_bugdir.bug_from_uuid(uuid)
added.append(new_bug)
return (removed, modified, added)
@@ -87,18 +87,17 @@ def bug_changes(old, new, bugs):
change_list = change_lines(old, new, ("time", "creator", "severity",
"target", "summary", "status", "assigned"))
- old.load_comments()
- old_comment_ids = [c.uuid for c in old.comment_root.traverse()]
- new.load_comments()
- new_comment_ids = [c.uuid for c in new.comment_root.traverse()]
+ old_comment_ids = [c.uuid for c in old.comments()]
+ new_comment_ids = [c.uuid for c in new.comments()]
change_strings = ["%s: %s -> %s" % f for f in change_list]
for comment_id in new_comment_ids:
if comment_id not in old_comment_ids:
- summary = comment_summary(new.comment_root.comment_from_uuid(comment_id), "new")
+ summary = comment_summary(new.comment_from_uuid(comment_id), "new")
change_strings.append(summary)
for comment_id in old_comment_ids:
if comment_id not in new_comment_ids:
- summary = comment_summary(new.comment.root.comment_from_uuid(comment_id), "removed")
+ summary = comment_summary(new.comment_from_uuid(comment_id),
+ "removed")
change_strings.append(summary)
if len(change_strings) == 0: