Put bd into read-only mode in becommands/diff.py.
authorW. Trevor King <wking@drexel.edu>
Mon, 27 Jul 2009 11:22:01 +0000 (07:22 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 27 Jul 2009 11:22:01 +0000 (07:22 -0400)
Otherwise comment comparison reads were triggering notice of the
  None -> EMPTY
transition in comment.extra_strings, which was causing a write to
disk.  This trigger is probably occuring in Bug and BugDir too.
Perhaps I should just remove the trigger...

becommands/diff.py

index 1ab21357ade8c9f0adfb26865dfe0643389fba1e..b0ef907ef73982ed509aad68f516ee7ea10eb9d7 100644 (file)
@@ -65,6 +65,12 @@ def execute(args, manipulate_encodings=True):
     else:
         if revision == None: # get the most recent revision
             revision = bd.rcs.revision_id(-1)
+        # move bd into memory-only mode to avoid altering disk version.
+        bd.load_all_bugs()
+        for bug in bd:
+            bug.load_settings()
+            bug.load_comments()
+        bd.set_sync_with_disk(False)
         old_bd = bd.duplicate_bugdir(revision)
         d = diff.Diff(old_bd, bd)
         tree = d.report_tree()