[Pkg-bazaar-commits] ./bzr-gtk/unstable r59: [merge] Aaron's fix to make gdiff support -r.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:16:14 UTC 2009


------------------------------------------------------------
revno: 59
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Mon 2006-06-12 00:36:33 +0200
message:
  [merge] Aaron's fix to make gdiff support -r.
modified:
  __init__.py
    ------------------------------------------------------------
    revno: 58.1.1
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: gtk
    timestamp: Sun 2006-06-11 17:03:56 -0400
    message:
      gdiff takes -r arguments
    modified:
      __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2006-06-07 09:27:13 +0000
+++ b/__init__.py	2006-06-11 21:03:56 +0000
@@ -52,13 +52,25 @@
     Otherwise, all changes for the tree are listed.
     """
     takes_args = []
-    takes_options = []
+    takes_options = ['revision']
 
     @display_command
     def run(self, revision=None, file_list=None):
-        tree1 = WorkingTree.open_containing(".")[0]
-        branch = tree1.branch
-        tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
+        wt = WorkingTree.open_containing(".")[0]
+        branch = wt.branch
+        if revision is not None:
+            if len(revision) == 1:
+                tree1 = wt
+                revision_id = revision[0].in_history(branch).rev_id
+                tree2 = branch.repository.revision_tree(revision_id)
+            elif len(revision) == 2:
+                revision_id_0 = revision[0].in_history(branch).rev_id
+                tree2 = branch.repository.revision_tree(revision_id_0)
+                revision_id_1 = revision[1].in_history(branch).rev_id
+                tree1 = branch.repository.revision_tree(revision_id_1)
+        else:
+            tree1 = wt
+            tree2 = tree1.basis_tree()
 
         from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
         import gtk



More information about the Pkg-bazaar-commits mailing list