/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/info.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
__all__ = ['show_bzrdir_info']
20
20
 
21
 
from cStringIO import StringIO
22
21
import time
23
22
import sys
24
23
 
25
 
from bzrlib import (
 
24
from . import (
26
25
    bzrdir,
27
26
    controldir,
28
27
    errors,
30
29
    osutils,
31
30
    urlutils,
32
31
    )
33
 
from bzrlib.errors import (NoWorkingTree, NotBranchError,
 
32
from .errors import (NoWorkingTree, NotBranchError,
34
33
                           NoRepositoryPresent, NotLocalUrl)
35
 
from bzrlib.missing import find_unmerged
 
34
from .missing import find_unmerged
 
35
from .sixish import (
 
36
    BytesIO,
 
37
    )
36
38
 
37
39
 
38
40
def plural(n, base='', pl=None):
329
331
 
330
332
def _show_repository_stats(repository, stats, outfile):
331
333
    """Show statistics about a repository."""
332
 
    f = StringIO()
 
334
    f = BytesIO()
333
335
    if 'revisions' in stats:
334
336
        revisions = stats['revisions']
335
337
        f.write('  %8d revision%s\n' % (revisions, plural(revisions)))
527
529
    """Hooks for the info command."""
528
530
 
529
531
    def __init__(self):
530
 
        super(InfoHooks, self).__init__("bzrlib.info", "hooks")
 
532
        super(InfoHooks, self).__init__("breezy.info", "hooks")
531
533
        self.add_hook('repository',
532
534
            "Invoked when displaying the statistics for a repository. "
533
535
            "repository is called with a statistics dictionary as returned "