~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

Merge in bzrdir work to enable checkout improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import time
20
20
 
21
21
from bzrlib.osutils import format_date
 
22
from bzrlib.workingtree import WorkingTree
22
23
 
23
24
 
24
25
def _countiter(it):
33
34
def show_info(b):
34
35
    import diff
35
36
    
36
 
    print 'branch format:', b.controlfile('branch-format', 'r').readline().rstrip('\n')
 
37
    print 'branch format:', b.control_files.get_utf8(
 
38
        'branch-format').readline().rstrip('\n')
37
39
 
38
40
    def plural(n, base='', pl=None):
39
41
        if n == 1:
45
47
 
46
48
    count_version_dirs = 0
47
49
 
48
 
    basis = b.basis_tree()
49
 
    working = b.working_tree()
 
50
    working = WorkingTree(b.base, b)
 
51
    basis = working.basis_tree()
50
52
    work_inv = working.inventory
51
53
    delta = diff.compare_trees(basis, working, want_unchanged=True)
52
54
    
83
85
    print '  %8d revision%s' % (revno, plural(revno))
84
86
    committers = {}
85
87
    for rev in history:
86
 
        committers[b.get_revision(rev).committer] = True
 
88
        committers[b.repository.get_revision(rev).committer] = True
87
89
    print '  %8d committer%s' % (len(committers), plural(len(committers)))
88
90
    if revno > 0:
89
 
        firstrev = b.get_revision(history[0])
 
91
        firstrev = b.repository.get_revision(history[0])
90
92
        age = int((time.time() - firstrev.timestamp) / 3600 / 24)
91
93
        print '  %8d day%s old' % (age, plural(age))
92
94
        print '   first revision: %s' % format_date(firstrev.timestamp,
93
95
                                                    firstrev.timezone)
94
96
 
95
 
        lastrev = b.get_revision(history[-1])
 
97
        lastrev = b.repository.get_revision(history[-1])
96
98
        print '  latest revision: %s' % format_date(lastrev.timestamp,
97
99
                                                    lastrev.timezone)
98
100
 
104
106
 
105
107
    print
106
108
    print 'revision store:'
107
 
    c, t = b.revision_store.total_size()
 
109
    c, t = b.repository.revision_store.total_size()
108
110
    print '  %8d revisions' % c
109
111
    print '  %8d kB' % (t/1024)
110
112