~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Aaron Bentley
  • Date: 2010-05-10 11:34:20 UTC
  • mfrom: (5218 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5221.
  • Revision ID: aaron@aaronbentley.com-20100510113420-toh2d5yioobb5uq1
Merged bzr.dev into transform-commit-full.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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,
27
28
    transactions,
28
29
    versionedfile,
29
30
    xml5,
37
38
from bzrlib.decorators import needs_read_lock, needs_write_lock
38
39
from bzrlib.repository import (
39
40
    CommitBuilder,
 
41
    IsInWriteGroupError,
40
42
    MetaDirRepository,
41
43
    MetaDirRepositoryFormat,
42
44
    RepositoryFormat,
43
45
    RootCommitBuilder,
44
46
    )
45
 
from bzrlib.trace import mutter, mutter_callsite
46
47
 
47
48
 
48
49
class _KnitParentsProvider(object):
210
211
    def _refresh_data(self):
211
212
        if not self.is_locked():
212
213
            return
 
214
        if self.is_in_write_group():
 
215
            raise IsInWriteGroupError(self)
213
216
        # Create a new transaction to force all knits to see the scope change.
214
217
        # This is safe because we're outside a write group.
215
218
        self.control_files._finish_transaction()
342
345
        :param shared: If true the repository will be initialized as a shared
343
346
                       repository.
344
347
        """
345
 
        mutter('creating repository in %s.', a_bzrdir.transport.base)
 
348
        trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
346
349
        dirs = ['knits']
347
350
        files = []
348
351
        utf8_files = [('format', self.get_format_string())]
360
363
        result.revisions.get_parent_map([('A',)])
361
364
        result.signatures.get_parent_map([('A',)])
362
365
        result.unlock()
 
366
        self._run_post_repo_init_hooks(result, a_bzrdir, shared)
363
367
        return result
364
368
 
365
369
    def open(self, a_bzrdir, _found=False, _override_transport=None):