~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/vf_repository.py

(jelmer) Switch the commit code over to use config stacks. (Bazaar
 Developers)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    check,
 
26
    config as _mod_config,
26
27
    debug,
27
28
    fetch as _mod_fetch,
28
29
    fifo_cache,
106
107
    # the default CommitBuilder does not manage trees whose root is versioned.
107
108
    _versioned_root = False
108
109
 
109
 
    def __init__(self, repository, parents, config, timestamp=None,
 
110
    def __init__(self, repository, parents, config_stack, timestamp=None,
110
111
                 timezone=None, committer=None, revprops=None,
111
112
                 revision_id=None, lossy=False):
112
113
        super(VersionedFileCommitBuilder, self).__init__(repository,
113
 
            parents, config, timestamp, timezone, committer, revprops,
 
114
            parents, config_stack, timestamp, timezone, committer, revprops,
114
115
            revision_id, lossy)
115
116
        try:
116
117
            basis_id = self.parents[0]
198
199
                       properties=self._revprops)
199
200
        rev.parent_ids = self.parents
200
201
        self.repository.add_revision(self._new_revision_id, rev,
201
 
            self.new_inventory, self._config)
 
202
            self.new_inventory, self._config_stack)
202
203
        self._ensure_fallback_inventories()
203
204
        self.repository.commit_write_group()
204
205
        return self._new_revision_id
1044
1045
        # TODO: jam 20070210 Shouldn't we check rev.revision_id and
1045
1046
        #       rev.parent_ids?
1046
1047
        _mod_revision.check_not_reserved_id(revision_id)
1047
 
        if config is not None and config.signature_needed():
 
1048
        if (config is not None and
 
1049
            config.get('create_signatures') == _mod_config.SIGN_ALWAYS):
1048
1050
            if inv is None:
1049
1051
                inv = self.get_inventory(revision_id)
1050
1052
            tree = InventoryRevisionTree(self, inv, revision_id)
1283
1285
            # result['size'] = t
1284
1286
        return result
1285
1287
 
1286
 
    def get_commit_builder(self, branch, parents, config, timestamp=None,
 
1288
    def get_commit_builder(self, branch, parents, config_stack, timestamp=None,
1287
1289
                           timezone=None, committer=None, revprops=None,
1288
1290
                           revision_id=None, lossy=False):
1289
1291
        """Obtain a CommitBuilder for this repository.
1290
1292
 
1291
1293
        :param branch: Branch to commit to.
1292
1294
        :param parents: Revision ids of the parents of the new revision.
1293
 
        :param config: Configuration to use.
 
1295
        :param config_stack: Configuration stack to use.
1294
1296
        :param timestamp: Optional timestamp recorded for commit.
1295
1297
        :param timezone: Optional timezone for timestamp.
1296
1298
        :param committer: Optional committer to set for commit.
1303
1305
            raise errors.BzrError("Cannot commit directly to a stacked branch"
1304
1306
                " in pre-2a formats. See "
1305
1307
                "https://bugs.launchpad.net/bzr/+bug/375013 for details.")
1306
 
        result = self._commit_builder_class(self, parents, config,
 
1308
        result = self._commit_builder_class(self, parents, config_stack,
1307
1309
            timestamp, timezone, committer, revprops, revision_id,
1308
1310
            lossy)
1309
1311
        self.start_write_group()