2
# -*- coding: UTF-8 -*-
3
"""GTK+ Branch Visualisation.
5
This is a bzr plugin that adds a new 'visualise' (alias: 'viz') command
6
which opens a GTK+ window to allow you to see the history of the branch
7
and relationships between revisions in a visual manner.
9
It's somewhat based on a screenshot I was handed of gitk. The top half
10
of the window shows the revisions in a list with a graph drawn down the
11
left hand side that joins them up and shows how they relate to each other.
12
The bottom hald of the window shows the details for the selected revision.
15
__copyright__ = "Copyright © 2005 Canonical Ltd."
16
__author__ = "Scott James Remnant <scott@ubuntu.com>"
20
import bzrlib.commands
22
from bzrlib.branch import Branch
24
from bzrkapp import BzrkApp
27
class cmd_visualise(bzrlib.commands.Command):
28
"""Graphically visualise this branch.
30
Opens a graphical window to allow you to see the history of the branch
31
and relationships between revisions in a visual manner,
33
The default starting point is latest revision on the branch, you can
34
specify a starting point with -r revision.
36
takes_options = [ "revision" ]
37
takes_args = [ "location?" ]
40
def run(self, location=".", revision=None):
41
branch = Branch.open_containing(location)
43
revid = branch.last_revision()
47
(revno, revid) = revision[0].in_history(branch)
50
app.show(branch, revid)
54
bzrlib.commands.register_command(cmd_visualise)