/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: 2007-02-15 16:56:15 UTC
  • mto: (157.1.8 trunk) (126.1.33 bzr-gtk)
  • mto: This revision was merged to the branch mainline in revision 160.
  • Revision ID: abentley@panoramicfeedback.com-20070215165615-3c8jyp7h91gsy0x0
Use lazy_import to reduce rocks time by .015s

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
if __name__ != 'bzrlib.plugins.gtk':
57
57
    warning("Not running as bzrlib.plugins.gtk, things may break.")
58
58
 
59
 
from bzrlib import errors
 
59
from bzrlib.lazy_import import lazy_import
 
60
lazy_import(globals(), """
 
61
from bzrlib import (
 
62
    branch,
 
63
    errors,
 
64
    workingtree,
 
65
    )
 
66
""")
 
67
 
60
68
from bzrlib.commands import Command, register_command, display_command
61
69
from bzrlib.errors import NotVersionedError, BzrCommandError, NoSuchFile
62
70
from bzrlib.commands import Command, register_command
63
71
from bzrlib.option import Option
64
 
from bzrlib.branch import Branch
65
 
from bzrlib.workingtree import WorkingTree
66
72
from bzrlib.bzrdir import BzrDir
67
73
 
68
74
import os.path
132
138
    takes_args = [ "location?" ]
133
139
    
134
140
    def run(self, location="."):
135
 
        (branch, path) = Branch.open_containing(location)
 
141
        (branch, path) = branch.Branch.open_containing(location)
136
142
        
137
143
        pygtk = import_pygtk()
138
144
        try:
160
166
    @display_command
161
167
    def run(self, revision=None, filename=None):
162
168
        set_ui_factory()
163
 
        wt = WorkingTree.open_containing(".")[0]
 
169
        wt = workingtree.WorkingTree.open_containing(".")[0]
164
170
        branch = wt.branch
165
171
        if revision is not None:
166
172
            if len(revision) == 1:
215
221
 
216
222
    def run(self, location=".", revision=None, limit=None):
217
223
        set_ui_factory()
218
 
        (branch, path) = Branch.open_containing(location)
 
224
        (branch, path) = branch.Branch.open_containing(location)
219
225
        branch.lock_read()
220
226
        branch.repository.lock_read()
221
227
        try:
277
283
        from annotate.config import GAnnotateConfig
278
284
 
279
285
        try:
280
 
            (tree, path) = WorkingTree.open_containing(filename)
 
286
            (tree, path) = workingtree.WorkingTree.open_containing(filename)
281
287
            branch = tree.branch
282
288
        except errors.NoWorkingTree:
283
 
            (branch, path) = Branch.open_containing(filename)
 
289
            (branch, path) = branch.Branch.open_containing(filename)
284
290
            tree = branch.basis_tree()
285
291
 
286
292
        file_id = tree.path2id(path)
343
349
        wt = None
344
350
        branch = None
345
351
        try:
346
 
            (wt, path) = WorkingTree.open_containing(filename)
 
352
            (wt, path) = workingtree.WorkingTree.open_containing(filename)
347
353
            branch = wt.branch
348
354
        except NotBranchError, e:
349
355
            path = e.path
350
356
        except NoWorkingTree, e:
351
357
            path = e.base
352
358
            try:
353
 
                (branch, path) = Branch.open_containing(path)
 
359
                (branch, path) = branch.Branch.open_containing(path)
354
360
            except NotBranchError, e:
355
361
                path = e.path
356
362
 
382
388
 
383
389
        set_ui_factory()
384
390
        from status import StatusDialog
385
 
        (wt, wt_path) = WorkingTree.open_containing(path)
 
391
        (wt, wt_path) = workingtree.WorkingTree.open_containing(path)
386
392
        status = StatusDialog(wt, wt_path)
387
393
        status.connect("destroy", gtk.main_quit)
388
394
        status.run()
394
400
    
395
401
    """
396
402
    def run(self):
397
 
        (wt, path) = WorkingTree.open_containing('.')
 
403
        (wt, path) = workingtree.WorkingTree.open_containing('.')
398
404
        
399
405
        pygtk = import_pygtk()
400
406
        try: