/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Martin Pool
  • Date: 2011-05-20 14:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 5923.
  • Revision ID: mbp@canonical.com-20110520144602-bqli0t6dj01gl0pv
Various pyflakes import fixes.

Some modules were used for subclassing or at module load time, so there is no
point loading them lazily.

Some were not imported when they should be.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
    """Show missing revisions in working tree."""
222
222
    branch = working.branch
223
223
    basis = working.basis_tree()
224
 
    work_inv = working.inventory
225
224
    branch_revno, branch_last_revision = branch.last_revision_info()
226
225
    try:
227
226
        tree_last_id = working.get_parent_ids()[0]
239
238
def _show_working_stats(working, outfile):
240
239
    """Show statistics about a working tree."""
241
240
    basis = working.basis_tree()
242
 
    work_inv = working.inventory
243
241
    delta = working.changes_from(basis, want_unchanged=True)
244
242
 
245
243
    outfile.write('\n')
260
258
    outfile.write('  %8d ignored\n' % ignore_cnt)
261
259
 
262
260
    dir_cnt = 0
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)):
 
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:
266
264
            dir_cnt += 1
267
265
    outfile.write('  %8d versioned %s\n' % (dir_cnt,
268
266
        plural(dir_cnt, 'subdirectory', 'subdirectories')))
481
479
    """Hooks for the info command."""
482
480
 
483
481
    def __init__(self):
484
 
        super(InfoHooks, self).__init__()
485
 
        self.create_hook(_mod_hooks.HookPoint('repository',
 
482
        super(InfoHooks, self).__init__("bzrlib.info", "hooks")
 
483
        self.add_hook('repository',
486
484
            "Invoked when displaying the statistics for a repository. "
487
485
            "repository is called with a statistics dictionary as returned "
488
 
            "by the repository and a file-like object to write to.", (1, 15), 
489
 
            None))
 
486
            "by the repository and a file-like object to write to.", (1, 15))
490
487
 
491
488
 
492
489
hooks = InfoHooks()