~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Jelmer Vernooij
  • Date: 2010-04-30 11:03:59 UTC
  • mto: This revision was merged to the branch mainline in revision 5197.
  • Revision ID: jelmer@samba.org-20100430110359-ow3e3grh7sxy93pa
Remove more unused imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
 
79
79
def gather_location_info(repository, branch=None, working=None):
80
80
    locs = {}
81
 
    repository_path = repository.user_url
 
81
    repository_path = repository.bzrdir.root_transport.base
82
82
    if branch is not None:
83
 
        branch_path = branch.user_url
 
83
        branch_path = branch.bzrdir.root_transport.base
84
84
        master_path = branch.get_bound_location()
85
85
        if master_path is None:
86
86
            master_path = branch_path
88
88
        branch_path = None
89
89
        master_path = None
90
90
    if working:
91
 
        working_path = working.user_url
 
91
        working_path = working.bzrdir.root_transport.base
92
92
        if working_path != branch_path:
93
93
            locs['light checkout root'] = working_path
94
94
        if master_path != branch_path:
221
221
    """Show missing revisions in working tree."""
222
222
    branch = working.branch
223
223
    basis = working.basis_tree()
 
224
    work_inv = working.inventory
224
225
    branch_revno, branch_last_revision = branch.last_revision_info()
225
226
    try:
226
227
        tree_last_id = working.get_parent_ids()[0]
238
239
def _show_working_stats(working, outfile):
239
240
    """Show statistics about a working tree."""
240
241
    basis = working.basis_tree()
 
242
    work_inv = working.inventory
241
243
    delta = working.changes_from(basis, want_unchanged=True)
242
244
 
243
245
    outfile.write('\n')
258
260
    outfile.write('  %8d ignored\n' % ignore_cnt)
259
261
 
260
262
    dir_cnt = 0
261
 
    root_id = working.get_root_id()
262
 
    for path, entry in working.iter_entries_by_dir():
263
 
        if entry.kind == 'directory' and entry.file_id != root_id:
 
263
    for file_id in work_inv:
 
264
        if (work_inv.get_file_kind(file_id) == 'directory' and
 
265
            not work_inv.is_root(file_id)):
264
266
            dir_cnt += 1
265
267
    outfile.write('  %8d versioned %s\n' % (dir_cnt,
266
268
        plural(dir_cnt, 'subdirectory', 'subdirectories')))
416
418
        if branch is None and tree is not None:
417
419
            phrase = "branchless tree"
418
420
        else:
419
 
            if (tree is not None and tree.user_url !=
420
 
                branch.user_url):
 
421
            if (tree is not None and tree.bzrdir.root_transport.base !=
 
422
                branch.bzrdir.root_transport.base):
421
423
                independence = ''
422
424
                phrase = "Lightweight checkout"
423
425
            elif branch.get_bound_location() is not None:
442
444
    """
443
445
    candidates  = []
444
446
    if (branch is not None and tree is not None and
445
 
        branch.user_url != tree.user_url):
 
447
        branch.bzrdir.root_transport.base !=
 
448
        tree.bzrdir.root_transport.base):
446
449
        branch = None
447
450
        repository = None
448
451
    non_aliases = set(bzrdir.format_registry.keys())
479
482
    """Hooks for the info command."""
480
483
 
481
484
    def __init__(self):
482
 
        super(InfoHooks, self).__init__("bzrlib.info", "hooks")
483
 
        self.add_hook('repository',
 
485
        super(InfoHooks, self).__init__()
 
486
        self.create_hook(_mod_hooks.HookPoint('repository',
484
487
            "Invoked when displaying the statistics for a repository. "
485
488
            "repository is called with a statistics dictionary as returned "
486
 
            "by the repository and a file-like object to write to.", (1, 15))
 
489
            "by the repository and a file-like object to write to.", (1, 15), 
 
490
            None))
487
491
 
488
492
 
489
493
hooks = InfoHooks()