libbe/diff.diff() was missing newly created bugs. Fixed.
authorW. Trevor King <wking@drexel.edu>
Sun, 23 Nov 2008 15:08:18 +0000 (10:08 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 23 Nov 2008 15:08:18 +0000 (10:08 -0500)
Also added blank lines to separate the new/modified/removed groups.

becommands/diff.py
libbe/diff.py

index 0a3bab187f6c3095692ccb6a460693e873cc7fea..3a8b42aeed44a298b52d11fc828489ce0d54e22e 100644 (file)
@@ -33,10 +33,11 @@ def execute(args):
     >>> if bd.rcs.versioned == True:
     ...     execute([original])
     ... else:
-    ...     print "a:cm: Bug A\\nstatus: open -> closed"
+    ...     print "a:cm: Bug A\\nstatus: open -> closed\\n"
     Modified bug reports:
     a:cm: Bug A
       status: open -> closed
+    <BLANKLINE>
     """
     options, args = get_parser().parse_args(args)
     if len(args) == 0:
index f147bce05c2164635a61c128e3b5460870e035b1..84b3bfe53d61901192e146bdc8a0147afec06cda 100644 (file)
@@ -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(new_bug.uuid):
+        if not old_bugdir.bug_map.has_key(uuid):
             new_bug = new_bugdir.bug_from_uuid(uuid)
             added.append(new_bug)
     return (removed, modified, added)
@@ -51,6 +51,7 @@ def diff_report(diff_data, bug_dir):
         print "New bug reports:"
         for bug in added:
             print bug.string(shortlist=True)
+        print ""
 
     if len(modified) > 0:
         printed = False
@@ -62,12 +63,14 @@ def diff_report(diff_data, bug_dir):
                 printed = True
                 print "Modified bug reports:"
             print change_str
+        print ""
 
     if len(removed) > 0: 
         print "Removed bug reports:"
         for bug in removed:
             print bug.string(shortlist=True)
-   
+        print ""
+
 def change_lines(old, new, attributes):
     change_list = []    
     for attr in attributes: