/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 viz/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 18:12:29 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629181229-1l2m4cf7vvbyh8qg
Simplify progress bar code, use embedded progress bar inside viz window.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
1
# -*- coding: UTF-8 -*-
3
2
"""GTK+ Branch Visualisation.
4
3
 
12
11
The bottom hald of the window shows the details for the selected revision.
13
12
"""
14
13
 
 
14
from branchwin import BranchWindow
 
15
 
15
16
__copyright__ = "Copyright © 2005 Canonical Ltd."
16
17
__author__    = "Scott James Remnant <scott@ubuntu.com>"
17
18
 
18
 
 
19
 
import bzrlib
20
 
import bzrlib.commands
21
 
 
22
 
from bzrlib.branch import Branch
23
 
 
24
 
from bzrkapp import BzrkApp
25
 
 
26
 
 
27
 
class cmd_visualise(bzrlib.commands.Command):
28
 
    """Graphically visualise this branch.
29
 
 
30
 
    Opens a graphical window to allow you to see the history of the branch
31
 
    and relationships between revisions in a visual manner,
32
 
 
33
 
    The default starting point is latest revision on the branch, you can
34
 
    specify a starting point with -r revision.
35
 
    """
36
 
    takes_options = [ "revision" ]
37
 
    takes_args = [ "location?" ]
38
 
    aliases = [ "viz" ]
39
 
 
40
 
    def run(self, location=".", revision=None):
41
 
        branch = Branch.open_containing(location)
42
 
        if revision is None:
43
 
            revid = branch.last_revision()
44
 
            if revid is None:
45
 
                return
46
 
        else:
47
 
            (revno, revid) = revision[0].in_history(branch)
48
 
 
49
 
        app = BzrkApp()
50
 
        app.show(branch, revid)
51
 
        app.main()
52
 
 
53
 
 
54
 
bzrlib.commands.register_command(cmd_visualise)