/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 15:55:48 UTC
  • mto: (4985.1.4 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125155548-0l352pujvt5bzl5e
Deploy addAttrCleanup on the whole test suite.

Several use case worth mentioning:

- setting a module or any other object attribute is the majority
by far. In some cases the setting itself is deferred but most of
the time we want to set at the same time we add the cleanup.

- there multiple occurrences of protecting hooks or ui factory
which are now useless (the test framework takes care of that now),

- there was some lambda uses that can now be avoided.

That first cleanup already simplifies things a lot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
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
24
24
    lockdir,
25
25
    osutils,
26
26
    revision as _mod_revision,
27
 
    trace,
28
27
    transactions,
29
28
    versionedfile,
30
29
    xml5,
43
42
    RepositoryFormat,
44
43
    RootCommitBuilder,
45
44
    )
 
45
from bzrlib.trace import mutter, mutter_callsite
46
46
 
47
47
 
48
48
class _KnitParentsProvider(object):
342
342
        :param shared: If true the repository will be initialized as a shared
343
343
                       repository.
344
344
        """
345
 
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
 
345
        mutter('creating repository in %s.', a_bzrdir.transport.base)
346
346
        dirs = ['knits']
347
347
        files = []
348
348
        utf8_files = [('format', self.get_format_string())]
360
360
        result.revisions.get_parent_map([('A',)])
361
361
        result.signatures.get_parent_map([('A',)])
362
362
        result.unlock()
363
 
        self._run_post_repo_init_hooks(result, a_bzrdir, shared)
364
363
        return result
365
364
 
366
365
    def open(self, a_bzrdir, _found=False, _override_transport=None):
445
444
    repository_class = KnitRepository
446
445
    _commit_builder_class = RootCommitBuilder
447
446
    rich_root_data = True
448
 
    experimental = True
449
447
    supports_tree_reference = True
450
448
    @property
451
449
    def _serializer(self):