/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: Szilveszter Farkas (Phanatic)
  • Date: 2006-12-25 08:51:59 UTC
  • mfrom: (66.2.19 bzr-gtk-meld)
  • Revision ID: szilveszter.farkas@gmail.com-20061225085159-fcbfh43k5xejkptf
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
"""GTK+ frontends to Bazaar commands """
16
16
 
 
17
from bzrlib import errors
17
18
from bzrlib.commands import Command, register_command, display_command
18
19
from bzrlib.errors import NotVersionedError, BzrCommandError, NoSuchFile
19
20
from bzrlib.commands import Command, register_command
167
168
        from annotate.gannotate import GAnnotateWindow
168
169
        from annotate.config import GAnnotateConfig
169
170
 
170
 
        (wt, path) = WorkingTree.open_containing(filename)
171
 
        branch = wt.branch
 
171
        try:
 
172
            (tree, path) = WorkingTree.open_containing(filename)
 
173
            branch = tree.branch
 
174
        except errors.NoWorkingTree:
 
175
            (branch, path) = Branch.open_containing(filename)
 
176
            tree = branch.basis_tree()
172
177
 
173
 
        file_id = wt.path2id(path)
 
178
        file_id = tree.path2id(path)
174
179
 
175
180
        if file_id is None:
176
181
            raise NotVersionedError(filename)
180
185
            revision_id = revision[0].in_history(branch).rev_id
181
186
            tree = branch.repository.revision_tree(revision_id)
182
187
        else:
183
 
            revision_id = None
184
 
            tree = wt
 
188
            revision_id = getattr(tree, 'get_revision_id', lambda: None)()
185
189
 
186
190
        window = GAnnotateWindow(all, plain)
187
191
        window.connect("destroy", lambda w: gtk.main_quit())