[Patch] show_diff between arbitrary revisions

Chris McCormick chris at mccormick.cx
Thu May 12 05:07:13 BST 2005


Hi,

Adds an optional argument to show_diff called target_revision which says
what revision to diff against.

Best,

Chris.

-------------------
chris at mccormick.cx
http://mccormick.cx
-------------- next part --------------
*** modified file 'bzrlib/diff.py'
--- bzrlib/diff.py 
+++ bzrlib/diff.py 
@@ -67,7 +67,7 @@
     print >>to_file
 
 
-def show_diff(b, revision, specific_files):
+def show_diff(b, revision, specific_files, target_revision=None):
     import sys
 
     if revision == None:
@@ -75,7 +75,10 @@
     else:
         old_tree = b.revision_tree(b.lookup_revision(revision))
         
-    new_tree = b.working_tree()
+    if (target_revision):
+        new_tree = b.revision_tree(b.lookup_revision(target_revision))
+    else:
+        new_tree = b.working_tree()
 
     # TODO: Options to control putting on a prefix or suffix, perhaps as a format string
     old_label = ''



More information about the bazaar mailing list