/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-06-11 21:03:56 UTC
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: aaron.bentley@utoronto.ca-20060611210356-3f9dace136553a55
gdiff takes -r arguments

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    Otherwise, all changes for the tree are listed.
53
53
    """
54
54
    takes_args = []
55
 
    takes_options = []
 
55
    takes_options = ['revision']
56
56
 
57
57
    @display_command
58
58
    def run(self, revision=None, file_list=None):
59
 
        tree1 = WorkingTree.open_containing(".")[0]
60
 
        branch = tree1.branch
61
 
        tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
 
59
        wt = WorkingTree.open_containing(".")[0]
 
60
        branch = wt.branch
 
61
        if revision is not None:
 
62
            if len(revision) == 1:
 
63
                tree1 = wt
 
64
                revision_id = revision[0].in_history(branch).rev_id
 
65
                tree2 = branch.repository.revision_tree(revision_id)
 
66
            elif len(revision) == 2:
 
67
                revision_id_0 = revision[0].in_history(branch).rev_id
 
68
                tree2 = branch.repository.revision_tree(revision_id_0)
 
69
                revision_id_1 = revision[1].in_history(branch).rev_id
 
70
                tree1 = branch.repository.revision_tree(revision_id_1)
 
71
        else:
 
72
            tree1 = wt
 
73
            tree2 = tree1.basis_tree()
62
74
 
63
75
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
64
76
        import gtk