~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Robert Collins
  • Date: 2010-02-27 12:27:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5061.
  • Revision ID: robertc@robertcollins.net-20100227122733-2o3me3fkk3pk36ns
``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a
``message_callback`` in the same way that commit does. (Robert Collins)

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