1
# Copyright (C) 2004, 2005 by Martin Pool
2
# Copyright (C) 2005 by Canonical Ltd
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
from bzrlib.osutils import format_date
22
from bzrlib.workingtree import WorkingTree
26
# surely there's a builtin for this?
37
print 'branch format:', b.control_files.get_utf8(
38
'branch-format').readline().rstrip('\n')
40
def plural(n, base='', pl=None):
48
count_version_dirs = 0
50
working = WorkingTree(b.base, b)
51
basis = working.basis_tree()
52
work_inv = working.inventory
53
delta = diff.compare_trees(basis, working, want_unchanged=True)
56
print 'in the working tree:'
57
print ' %8s unchanged' % len(delta.unchanged)
58
print ' %8d modified' % len(delta.modified)
59
print ' %8d added' % len(delta.added)
60
print ' %8d removed' % len(delta.removed)
61
print ' %8d renamed' % len(delta.renamed)
63
ignore_cnt = unknown_cnt = 0
64
for path in working.extras():
65
if working.is_ignored(path):
70
print ' %8d unknown' % unknown_cnt
71
print ' %8d ignored' % ignore_cnt
74
for file_id in work_inv:
75
if work_inv.get_file_kind(file_id) == 'directory':
77
print ' %8d versioned %s' \
79
plural(dir_cnt, 'subdirectory', 'subdirectories'))
82
print 'branch history:'
83
history = b.revision_history()
85
print ' %8d revision%s' % (revno, plural(revno))
88
committers[b.repository.get_revision(rev).committer] = True
89
print ' %8d committer%s' % (len(committers), plural(len(committers)))
91
firstrev = b.repository.get_revision(history[0])
92
age = int((time.time() - firstrev.timestamp) / 3600 / 24)
93
print ' %8d day%s old' % (age, plural(age))
94
print ' first revision: %s' % format_date(firstrev.timestamp,
97
lastrev = b.repository.get_revision(history[-1])
98
print ' latest revision: %s' % format_date(lastrev.timestamp,
102
# print 'text store:'
103
# c, t = b.text_store.total_size()
104
# print ' %8d file texts' % c
105
# print ' %8d kB' % (t/1024)
108
print 'revision store:'
109
c, t = b.repository.revision_store.total_size()
110
print ' %8d revisions' % c
111
print ' %8d kB' % (t/1024)
115
# print 'inventory store:'
116
# c, t = b.inventory_store.total_size()
117
# print ' %8d inventories' % c
118
# print ' %8d kB' % (t/1024)