~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-28 10:33:44 UTC
  • mfrom: (5171.2.3 401599-strict-warnings)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100428103344-e32qf3cn1avdd2cb
Don't mention --no-strict when we just issue the warning about unclean trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
__all__ = ['show_bzrdir_info']
18
18
 
19
19
from cStringIO import StringIO
 
20
import os
20
21
import time
21
22
import sys
22
23
 
23
24
from bzrlib import (
24
25
    bzrdir,
 
26
    diff,
25
27
    errors,
26
28
    hooks as _mod_hooks,
27
29
    osutils,
221
223
    """Show missing revisions in working tree."""
222
224
    branch = working.branch
223
225
    basis = working.basis_tree()
 
226
    work_inv = working.inventory
224
227
    branch_revno, branch_last_revision = branch.last_revision_info()
225
228
    try:
226
229
        tree_last_id = working.get_parent_ids()[0]
238
241
def _show_working_stats(working, outfile):
239
242
    """Show statistics about a working tree."""
240
243
    basis = working.basis_tree()
 
244
    work_inv = working.inventory
241
245
    delta = working.changes_from(basis, want_unchanged=True)
242
246
 
243
247
    outfile.write('\n')
258
262
    outfile.write('  %8d ignored\n' % ignore_cnt)
259
263
 
260
264
    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:
 
265
    for file_id in work_inv:
 
266
        if (work_inv.get_file_kind(file_id) == 'directory' and
 
267
            not work_inv.is_root(file_id)):
264
268
            dir_cnt += 1
265
269
    outfile.write('  %8d versioned %s\n' % (dir_cnt,
266
270
        plural(dir_cnt, 'subdirectory', 'subdirectories')))
479
483
    """Hooks for the info command."""
480
484
 
481
485
    def __init__(self):
482
 
        super(InfoHooks, self).__init__("bzrlib.info", "hooks")
483
 
        self.add_hook('repository',
 
486
        super(InfoHooks, self).__init__()
 
487
        self.create_hook(_mod_hooks.HookPoint('repository',
484
488
            "Invoked when displaying the statistics for a repository. "
485
489
            "repository is called with a statistics dictionary as returned "
486
 
            "by the repository and a file-like object to write to.", (1, 15))
 
490
            "by the repository and a file-like object to write to.", (1, 15), 
 
491
            None))
487
492
 
488
493
 
489
494
hooks = InfoHooks()