~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

(jelmer) Remove config argument from VersionedFileRepository.add_revision()
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
 
 
1
# Copyright (C) 2005-2010 Canonical Ltd
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
from __future__ import absolute_import
16
18
 
17
19
__all__ = ['show_bzrdir_info']
18
20
 
19
 
import os
 
21
from cStringIO import StringIO
20
22
import time
21
23
import sys
22
24
 
23
25
from bzrlib import (
24
26
    bzrdir,
25
 
    diff,
 
27
    controldir,
26
28
    errors,
 
29
    hooks as _mod_hooks,
27
30
    osutils,
28
31
    urlutils,
29
32
    )
30
33
from bzrlib.errors import (NoWorkingTree, NotBranchError,
31
34
                           NoRepositoryPresent, NotLocalUrl)
32
35
from bzrlib.missing import find_unmerged
33
 
from bzrlib.symbol_versioning import (deprecated_function,
34
 
        zero_eighteen)
35
36
 
36
37
 
37
38
def plural(n, base='', pl=None):
78
79
        return ["  %*s: %s\n" % (max_len, l, u) for l, u in self.locs ]
79
80
 
80
81
 
81
 
def gather_location_info(repository, branch=None, working=None):
 
82
def gather_location_info(repository=None, branch=None, working=None,
 
83
        control=None):
82
84
    locs = {}
83
 
    repository_path = repository.bzrdir.root_transport.base
84
85
    if branch is not None:
85
 
        branch_path = branch.bzrdir.root_transport.base
 
86
        branch_path = branch.user_url
86
87
        master_path = branch.get_bound_location()
87
88
        if master_path is None:
88
89
            master_path = branch_path
89
90
    else:
90
91
        branch_path = None
91
92
        master_path = None
 
93
        try:
 
94
            if control is not None and control.get_branch_reference():
 
95
                locs['checkout of branch'] = control.get_branch_reference()
 
96
        except NotBranchError:
 
97
            pass
92
98
    if working:
93
 
        working_path = working.bzrdir.root_transport.base
 
99
        working_path = working.user_url
94
100
        if working_path != branch_path:
95
101
            locs['light checkout root'] = working_path
96
102
        if master_path != branch_path:
107
113
            locs['branch root'] = branch_path
108
114
    else:
109
115
        working_path = None
110
 
        if repository.is_shared():
 
116
        if repository is not None and repository.is_shared():
111
117
            # lightweight checkout of branch in shared repository
112
118
            if branch_path is not None:
113
119
                locs['repository branch'] = branch_path
114
120
        elif branch_path is not None:
115
121
            # standalone
116
122
            locs['branch root'] = branch_path
117
 
            if master_path != branch_path:
118
 
                locs['bound to branch'] = master_path
 
123
        elif repository is not None:
 
124
            locs['repository'] = repository.user_url
 
125
        elif control is not None:
 
126
            locs['control directory'] = control.user_url
119
127
        else:
120
 
            locs['repository'] = repository_path
121
 
    if repository.is_shared():
 
128
            # Really, at least a control directory should be
 
129
            # passed in for this method to be useful.
 
130
            pass
 
131
        if master_path != branch_path:
 
132
            locs['bound to branch'] = master_path
 
133
    if repository is not None and repository.is_shared():
122
134
        # lightweight checkout of branch in shared repository
123
 
        locs['shared repository'] = repository_path
124
 
    order = ['light checkout root', 'repository checkout root',
125
 
             'checkout root', 'checkout of branch', 'shared repository',
 
135
        locs['shared repository'] = repository.user_url
 
136
    order = ['control directory', 'light checkout root',
 
137
             'repository checkout root', 'checkout root',
 
138
             'checkout of branch', 'shared repository',
126
139
             'repository', 'repository branch', 'branch root',
127
140
             'bound to branch']
128
141
    return [(n, locs[n]) for n in order if n in locs]
129
142
 
130
143
 
131
 
def _show_location_info(locs):
 
144
def _show_location_info(locs, outfile):
132
145
    """Show known locations for working, branch and repository."""
133
 
    print 'Location:'
134
 
    path_list = LocationList(os.getcwd())
 
146
    outfile.write('Location:\n')
 
147
    path_list = LocationList(osutils.getcwd())
135
148
    for name, loc in locs:
136
149
        path_list.add_url(name, loc)
137
 
    sys.stdout.writelines(path_list.get_lines())
 
150
    outfile.writelines(path_list.get_lines())
 
151
 
138
152
 
139
153
def _gather_related_branches(branch):
140
 
    locs = LocationList(os.getcwd())
 
154
    locs = LocationList(osutils.getcwd())
141
155
    locs.add_url('public branch', branch.get_public_branch())
142
156
    locs.add_url('push branch', branch.get_push_location())
143
157
    locs.add_url('parent branch', branch.get_parent())
144
158
    locs.add_url('submit branch', branch.get_submit_branch())
 
159
    try:
 
160
        locs.add_url('stacked on', branch.get_stacked_on_url())
 
161
    except (errors.UnstackableBranchFormat, errors.UnstackableRepositoryFormat,
 
162
        errors.NotStacked):
 
163
        pass
145
164
    return locs
146
165
 
 
166
 
147
167
def _show_related_info(branch, outfile):
148
168
    """Show parent and push location of branch."""
149
169
    locs = _gather_related_branches(branch)
150
170
    if len(locs.locs) > 0:
151
 
        print >> outfile
152
 
        print >> outfile, 'Related branches:'
 
171
        outfile.write('\n')
 
172
        outfile.write('Related branches:\n')
153
173
        outfile.writelines(locs.get_lines())
154
174
 
155
175
 
156
 
def _show_format_info(control=None, repository=None, branch=None, working=None):
 
176
def _show_control_dir_info(control, outfile):
 
177
    """Show control dir information."""
 
178
    if control._format.colocated_branches:
 
179
        outfile.write('\n')
 
180
        outfile.write('Control directory:\n')
 
181
        outfile.write('         %d branches\n' % len(control.list_branches()))
 
182
 
 
183
 
 
184
def _show_format_info(control=None, repository=None, branch=None,
 
185
                      working=None, outfile=None):
157
186
    """Show known formats for control, working, branch and repository."""
158
 
    print
159
 
    print 'Format:'
 
187
    outfile.write('\n')
 
188
    outfile.write('Format:\n')
160
189
    if control:
161
 
        print '       control: %s' % control._format.get_format_description()
 
190
        outfile.write('       control: %s\n' %
 
191
            control._format.get_format_description())
162
192
    if working:
163
 
        print '  working tree: %s' % working._format.get_format_description()
 
193
        outfile.write('  working tree: %s\n' %
 
194
            working._format.get_format_description())
164
195
    if branch:
165
 
        print '        branch: %s' % branch._format.get_format_description()
 
196
        outfile.write('        branch: %s\n' %
 
197
            branch._format.get_format_description())
166
198
    if repository:
167
 
        print '    repository: %s' % repository._format.get_format_description()
168
 
 
169
 
 
170
 
def _show_locking_info(repository, branch=None, working=None):
 
199
        outfile.write('    repository: %s\n' %
 
200
            repository._format.get_format_description())
 
201
 
 
202
 
 
203
def _show_locking_info(repository, branch=None, working=None, outfile=None):
171
204
    """Show locking status of working, branch and repository."""
172
205
    if (repository.get_physical_lock_status() or
173
206
        (branch and branch.get_physical_lock_status()) or
174
207
        (working and working.get_physical_lock_status())):
175
 
        print
176
 
        print 'Lock status:'
 
208
        outfile.write('\n')
 
209
        outfile.write('Lock status:\n')
177
210
        if working:
178
211
            if working.get_physical_lock_status():
179
212
                status = 'locked'
180
213
            else:
181
214
                status = 'unlocked'
182
 
            print '  working tree: %s' % status
 
215
            outfile.write('  working tree: %s\n' % status)
183
216
        if branch:
184
217
            if branch.get_physical_lock_status():
185
218
                status = 'locked'
186
219
            else:
187
220
                status = 'unlocked'
188
 
            print '        branch: %s' % status
 
221
            outfile.write('        branch: %s\n' % status)
189
222
        if repository:
190
223
            if repository.get_physical_lock_status():
191
224
                status = 'locked'
192
225
            else:
193
226
                status = 'unlocked'
194
 
            print '    repository: %s' % status
195
 
 
196
 
 
197
 
def _show_missing_revisions_branch(branch):
 
227
            outfile.write('    repository: %s\n' % status)
 
228
 
 
229
 
 
230
def _show_missing_revisions_branch(branch, outfile):
198
231
    """Show missing master revisions in branch."""
199
232
    # Try with inaccessible branch ?
200
233
    master = branch.get_master_branch()
201
234
    if master:
202
235
        local_extra, remote_extra = find_unmerged(branch, master)
203
236
        if remote_extra:
204
 
            print
205
 
            print 'Branch is out of date: missing %d revision%s.' % (
206
 
                len(remote_extra), plural(len(remote_extra)))
207
 
 
208
 
 
209
 
def _show_missing_revisions_working(working):
 
237
            outfile.write('\n')
 
238
            outfile.write(('Branch is out of date: missing %d '
 
239
                'revision%s.\n') % (len(remote_extra),
 
240
                plural(len(remote_extra))))
 
241
 
 
242
 
 
243
def _show_missing_revisions_working(working, outfile):
210
244
    """Show missing revisions in working tree."""
211
245
    branch = working.branch
212
246
    basis = working.basis_tree()
213
 
    work_inv = working.inventory
214
 
    branch_revno, branch_last_revision = branch.last_revision_info()
 
247
    try:
 
248
        branch_revno, branch_last_revision = branch.last_revision_info()
 
249
    except errors.UnsupportedOperation:
 
250
        return
215
251
    try:
216
252
        tree_last_id = working.get_parent_ids()[0]
217
253
    except IndexError:
220
256
    if branch_revno and tree_last_id != branch_last_revision:
221
257
        tree_last_revno = branch.revision_id_to_revno(tree_last_id)
222
258
        missing_count = branch_revno - tree_last_revno
223
 
        print
224
 
        print 'Working tree is out of date: missing %d revision%s.' % (
225
 
            missing_count, plural(missing_count))
226
 
 
227
 
 
228
 
def _show_working_stats(working):
 
259
        outfile.write('\n')
 
260
        outfile.write(('Working tree is out of date: missing %d '
 
261
            'revision%s.\n') % (missing_count, plural(missing_count)))
 
262
 
 
263
 
 
264
def _show_working_stats(working, outfile):
229
265
    """Show statistics about a working tree."""
230
266
    basis = working.basis_tree()
231
 
    work_inv = working.inventory
232
267
    delta = working.changes_from(basis, want_unchanged=True)
233
268
 
234
 
    print
235
 
    print 'In the working tree:'
236
 
    print '  %8s unchanged' % len(delta.unchanged)
237
 
    print '  %8d modified' % len(delta.modified)
238
 
    print '  %8d added' % len(delta.added)
239
 
    print '  %8d removed' % len(delta.removed)
240
 
    print '  %8d renamed' % len(delta.renamed)
 
269
    outfile.write('\n')
 
270
    outfile.write('In the working tree:\n')
 
271
    outfile.write('  %8s unchanged\n' % len(delta.unchanged))
 
272
    outfile.write('  %8d modified\n' % len(delta.modified))
 
273
    outfile.write('  %8d added\n' % len(delta.added))
 
274
    outfile.write('  %8d removed\n' % len(delta.removed))
 
275
    outfile.write('  %8d renamed\n' % len(delta.renamed))
241
276
 
242
277
    ignore_cnt = unknown_cnt = 0
243
278
    for path in working.extras():
245
280
            ignore_cnt += 1
246
281
        else:
247
282
            unknown_cnt += 1
248
 
    print '  %8d unknown' % unknown_cnt
249
 
    print '  %8d ignored' % ignore_cnt
 
283
    outfile.write('  %8d unknown\n' % unknown_cnt)
 
284
    outfile.write('  %8d ignored\n' % ignore_cnt)
250
285
 
251
286
    dir_cnt = 0
252
 
    for file_id in work_inv:
253
 
        if (work_inv.get_file_kind(file_id) == 'directory' and 
254
 
            not work_inv.is_root(file_id)):
 
287
    root_id = working.get_root_id()
 
288
    for path, entry in working.iter_entries_by_dir():
 
289
        if entry.kind == 'directory' and entry.file_id != root_id:
255
290
            dir_cnt += 1
256
 
    print '  %8d versioned %s' \
257
 
          % (dir_cnt,
258
 
             plural(dir_cnt, 'subdirectory', 'subdirectories'))
259
 
 
260
 
 
261
 
def _show_branch_stats(branch, verbose):
 
291
    outfile.write('  %8d versioned %s\n' % (dir_cnt,
 
292
        plural(dir_cnt, 'subdirectory', 'subdirectories')))
 
293
 
 
294
 
 
295
def _show_branch_stats(branch, verbose, outfile):
262
296
    """Show statistics about a branch."""
263
 
    revno, head = branch.last_revision_info()
264
 
    print
265
 
    print 'Branch history:'
266
 
    print '  %8d revision%s' % (revno, plural(revno))
 
297
    try:
 
298
        revno, head = branch.last_revision_info()
 
299
    except errors.UnsupportedOperation:
 
300
        return {}
 
301
    outfile.write('\n')
 
302
    outfile.write('Branch history:\n')
 
303
    outfile.write('  %8d revision%s\n' % (revno, plural(revno)))
267
304
    stats = branch.repository.gather_stats(head, committers=verbose)
268
305
    if verbose:
269
306
        committers = stats['committers']
270
 
        print '  %8d committer%s' % (committers, plural(committers))
 
307
        outfile.write('  %8d committer%s\n' % (committers,
 
308
            plural(committers)))
271
309
    if revno:
272
310
        timestamp, timezone = stats['firstrev']
273
311
        age = int((time.time() - timestamp) / 3600 / 24)
274
 
        print '  %8d day%s old' % (age, plural(age))
275
 
        print '   first revision: %s' % osutils.format_date(timestamp,
276
 
            timezone)
 
312
        outfile.write('  %8d day%s old\n' % (age, plural(age)))
 
313
        outfile.write('   first revision: %s\n' %
 
314
            osutils.format_date(timestamp, timezone))
277
315
        timestamp, timezone = stats['latestrev']
278
 
        print '  latest revision: %s' % osutils.format_date(timestamp,
279
 
            timezone)
 
316
        outfile.write('  latest revision: %s\n' %
 
317
            osutils.format_date(timestamp, timezone))
280
318
    return stats
281
319
 
282
320
 
283
 
def _show_repository_info(repository):
 
321
def _show_repository_info(repository, outfile):
284
322
    """Show settings of a repository."""
285
323
    if repository.make_working_trees():
286
 
        print
287
 
        print 'Create working tree for new branches inside the repository.'
288
 
 
289
 
 
290
 
def _show_repository_stats(stats):
 
324
        outfile.write('\n')
 
325
        outfile.write('Create working tree for new branches inside '
 
326
            'the repository.\n')
 
327
 
 
328
 
 
329
def _show_repository_stats(repository, stats, outfile):
291
330
    """Show statistics about a repository."""
292
 
    if 'revisions' in stats or 'size' in stats:
293
 
        print
294
 
        print 'Repository:'
 
331
    f = StringIO()
295
332
    if 'revisions' in stats:
296
333
        revisions = stats['revisions']
297
 
        print '  %8d revision%s' % (revisions, plural(revisions))
 
334
        f.write('  %8d revision%s\n' % (revisions, plural(revisions)))
298
335
    if 'size' in stats:
299
 
        print '  %8d KiB' % (stats['size']/1024)
300
 
 
301
 
def show_bzrdir_info(a_bzrdir, verbose=False):
 
336
        f.write('  %8d KiB\n' % (stats['size']/1024))
 
337
    for hook in hooks['repository']:
 
338
        hook(repository, stats, f)
 
339
    if f.getvalue() != "":
 
340
        outfile.write('\n')
 
341
        outfile.write('Repository:\n')
 
342
        outfile.write(f.getvalue())
 
343
 
 
344
 
 
345
def show_bzrdir_info(a_bzrdir, verbose=False, outfile=None):
302
346
    """Output to stdout the 'info' for a_bzrdir."""
 
347
    if outfile is None:
 
348
        outfile = sys.stdout
303
349
    try:
304
350
        tree = a_bzrdir.open_workingtree(
305
351
            recommend_upgrade=False)
306
 
    except (NoWorkingTree, NotLocalUrl):
 
352
    except (NoWorkingTree, NotLocalUrl, NotBranchError):
307
353
        tree = None
308
354
        try:
309
355
            branch = a_bzrdir.open_branch()
312
358
            try:
313
359
                repository = a_bzrdir.open_repository()
314
360
            except NoRepositoryPresent:
315
 
                # Return silently; cmd_info already returned NotBranchError
316
 
                # if no bzrdir could be opened.
317
 
                return
 
361
                lockable = None
 
362
                repository = None
318
363
            else:
319
364
                lockable = repository
320
365
        else:
325
370
        repository = branch.repository
326
371
        lockable = tree
327
372
 
328
 
    lockable.lock_read()
 
373
    if lockable is not None:
 
374
        lockable.lock_read()
329
375
    try:
330
 
        show_component_info(a_bzrdir, repository, branch, tree, verbose)
 
376
        show_component_info(a_bzrdir, repository, branch, tree, verbose,
 
377
                            outfile)
331
378
    finally:
332
 
        lockable.unlock()
 
379
        if lockable is not None:
 
380
            lockable.unlock()
333
381
 
334
382
 
335
383
def show_component_info(control, repository, branch=None, working=None,
336
 
    verbose=1):
 
384
    verbose=1, outfile=None):
337
385
    """Write info about all bzrdir components to stdout"""
 
386
    if outfile is None:
 
387
        outfile = sys.stdout
338
388
    if verbose is False:
339
389
        verbose = 1
340
390
    if verbose is True:
341
391
        verbose = 2
342
 
    layout = describe_layout(repository, branch, working)
 
392
    layout = describe_layout(repository, branch, working, control)
343
393
    format = describe_format(control, repository, branch, working)
344
 
    print "%s (format: %s)" % (layout, format)
345
 
    _show_location_info(gather_location_info(repository, branch, working))
 
394
    outfile.write("%s (format: %s)\n" % (layout, format))
 
395
    _show_location_info(
 
396
        gather_location_info(control=control, repository=repository,
 
397
            branch=branch, working=working),
 
398
        outfile)
346
399
    if branch is not None:
347
 
        _show_related_info(branch, sys.stdout)
 
400
        _show_related_info(branch, outfile)
348
401
    if verbose == 0:
349
402
        return
350
 
    _show_format_info(control, repository, branch, working)
351
 
    _show_locking_info(repository, branch, working)
 
403
    _show_format_info(control, repository, branch, working, outfile)
 
404
    _show_locking_info(repository, branch, working, outfile)
 
405
    _show_control_dir_info(control, outfile)
352
406
    if branch is not None:
353
 
        _show_missing_revisions_branch(branch)
 
407
        _show_missing_revisions_branch(branch, outfile)
354
408
    if working is not None:
355
 
        _show_missing_revisions_working(working)
356
 
        _show_working_stats(working)
 
409
        _show_missing_revisions_working(working, outfile)
 
410
        _show_working_stats(working, outfile)
357
411
    elif branch is not None:
358
 
        _show_missing_revisions_branch(branch)
 
412
        _show_missing_revisions_branch(branch, outfile)
359
413
    if branch is not None:
360
 
        stats = _show_branch_stats(branch, verbose==2)
 
414
        show_committers = verbose >= 2
 
415
        stats = _show_branch_stats(branch, show_committers, outfile)
361
416
    else:
362
417
        stats = repository.gather_stats()
363
418
    if branch is None and working is None:
364
 
        _show_repository_info(repository)
365
 
    _show_repository_stats(stats)
366
 
 
367
 
 
368
 
def describe_layout(repository=None, branch=None, tree=None):
 
419
        _show_repository_info(repository, outfile)
 
420
    _show_repository_stats(repository, stats, outfile)
 
421
 
 
422
 
 
423
def describe_layout(repository=None, branch=None, tree=None, control=None):
369
424
    """Convert a control directory layout into a user-understandable term
370
425
 
371
426
    Common outputs include "Standalone tree", "Repository branch" and
372
427
    "Checkout".  Uncommon outputs include "Unshared repository with trees"
373
428
    and "Empty control directory"
374
429
    """
 
430
    if branch is None and control is not None:
 
431
        try:
 
432
            branch_reference = control.get_branch_reference()
 
433
        except NotBranchError:
 
434
            pass
 
435
        else:
 
436
            if branch_reference is not None:
 
437
                return "Dangling branch reference"
375
438
    if repository is None:
376
439
        return 'Empty control directory'
377
440
    if branch is None and tree is None:
394
457
        if branch is None and tree is not None:
395
458
            phrase = "branchless tree"
396
459
        else:
397
 
            if (tree is not None and tree.bzrdir.root_transport.base !=
398
 
                branch.bzrdir.root_transport.base):
 
460
            if (tree is not None and tree.user_url !=
 
461
                branch.user_url):
399
462
                independence = ''
400
463
                phrase = "Lightweight checkout"
401
464
            elif branch.get_bound_location() is not None:
420
483
    """
421
484
    candidates  = []
422
485
    if (branch is not None and tree is not None and
423
 
        branch.bzrdir.root_transport.base !=
424
 
        tree.bzrdir.root_transport.base):
 
486
        branch.user_url != tree.user_url):
425
487
        branch = None
426
488
        repository = None
427
 
    for key in bzrdir.format_registry.keys():
428
 
        format = bzrdir.format_registry.make_bzrdir(key)
 
489
    non_aliases = set(controldir.format_registry.keys())
 
490
    non_aliases.difference_update(controldir.format_registry.aliases())
 
491
    for key in non_aliases:
 
492
        format = controldir.format_registry.make_bzrdir(key)
429
493
        if isinstance(format, bzrdir.BzrDirMetaFormat1):
430
494
            if (tree and format.workingtree_format !=
431
495
                tree._format):
441
505
        candidates.append(key)
442
506
    if len(candidates) == 0:
443
507
        return 'unnamed'
444
 
    new_candidates = [c for c in candidates if c != 'default']
445
 
    if len(new_candidates) > 0:
446
 
        candidates = new_candidates
 
508
    candidates.sort()
447
509
    new_candidates = [c for c in candidates if not
448
 
        bzrdir.format_registry.get_info(c).hidden]
 
510
        controldir.format_registry.get_info(c).hidden]
449
511
    if len(new_candidates) > 0:
 
512
        # If there are any non-hidden formats that match, only return those to
 
513
        # avoid listing hidden formats except when only a hidden format will
 
514
        # do.
450
515
        candidates = new_candidates
451
516
    return ' or '.join(candidates)
452
517
 
453
518
 
454
 
@deprecated_function(zero_eighteen)
455
 
def show_tree_info(working, verbose):
456
 
    """Output to stdout the 'info' for working."""
457
 
    branch = working.branch
458
 
    repository = branch.repository
459
 
    control = working.bzrdir
460
 
    show_component_info(control, repository, branch, working, verbose)
461
 
 
462
 
 
463
 
@deprecated_function(zero_eighteen)
464
 
def show_branch_info(branch, verbose):
465
 
    """Output to stdout the 'info' for branch."""
466
 
    repository = branch.repository
467
 
    control = branch.bzrdir
468
 
    show_component_info(control, repository, branch, verbose=verbose)
469
 
 
470
 
 
471
 
@deprecated_function(zero_eighteen)
472
 
def show_repository_info(repository, verbose):
473
 
    """Output to stdout the 'info' for repository."""
474
 
    control = repository.bzrdir
475
 
    show_component_info(control, repository, verbose=verbose)
 
519
class InfoHooks(_mod_hooks.Hooks):
 
520
    """Hooks for the info command."""
 
521
 
 
522
    def __init__(self):
 
523
        super(InfoHooks, self).__init__("bzrlib.info", "hooks")
 
524
        self.add_hook('repository',
 
525
            "Invoked when displaying the statistics for a repository. "
 
526
            "repository is called with a statistics dictionary as returned "
 
527
            "by the repository and a file-like object to write to.", (1, 15))
 
528
 
 
529
 
 
530
hooks = InfoHooks()