/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: David Allouche
  • Date: 2006-05-08 13:03:59 UTC
  • Revision ID: david.allouche@canonical.com-20060508130359-f9a471d0d0b1dcf2
remove --robust, pyflakes fixes, update README

Thanks to Robert Collins' new graphing logic, the --robust option is
no longer needed to prevent extreme graph width on broken branches.
That allows removing a bunch of flaky code.

Remove a few spurious imports (thanks to pyflakes).

Update README to request bzr>=0.8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
__author__    = "Scott James Remnant <scott@ubuntu.com>"
17
17
 
18
18
 
19
 
import bzrlib
20
 
import bzrlib.commands
 
19
from bzrlib.commands import Command, register_command
21
20
from bzrlib.option import Option
22
21
from bzrlib.branch import Branch
23
22
 
24
23
 
25
 
class cmd_visualise(bzrlib.commands.Command):
 
24
class cmd_visualise(Command):
26
25
    """Graphically visualise this branch.
27
26
 
28
27
    Opens a graphical window to allow you to see the history of the branch
30
29
 
31
30
    The default starting point is latest revision on the branch, you can
32
31
    specify a starting point with -r revision.
33
 
 
34
 
    The --robust option enables removal of redundant parents. It is sometimes
35
 
    useful on branches that contain corrupt revisions.
36
32
    """
37
33
    takes_options = [
38
34
        "revision",
39
 
        Option('robust', "ignore redundant parents"),
40
35
        Option('maxnum', "maximum number of revisions to display", int, 'count')]
41
36
    takes_args = [ "location?" ]
42
37
    aliases = [ "visualize", "vis", "viz" ]
43
38
 
44
 
    def run(self, location=".", revision=None, robust=False,
45
 
            maxnum=None):
 
39
    def run(self, location=".", revision=None, maxnum=None):
46
40
        (branch, path) = Branch.open_containing(location)
47
41
        branch.lock_read()
48
42
        branch.repository.lock_read()
57
51
            from bzrkapp import BzrkApp
58
52
                
59
53
            app = BzrkApp()
60
 
            app.show(branch, revid, robust, maxnum)
 
54
            app.show(branch, revid, maxnum)
61
55
        finally:
62
56
            branch.repository.unlock()
63
57
            branch.unlock()
64
58
        app.main()
65
59
 
66
60
 
67
 
bzrlib.commands.register_command(cmd_visualise)
 
61
register_command(cmd_visualise)