~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/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:
78
78
    # being committed to
79
79
    updates_branch = False
80
80
 
81
 
    def __init__(self, repository, parents, config, timestamp=None,
 
81
    def __init__(self, repository, parents, config_stack, timestamp=None,
82
82
                 timezone=None, committer=None, revprops=None,
83
83
                 revision_id=None, lossy=False):
84
84
        """Initiate a CommitBuilder.
93
93
        :param lossy: Whether to discard data that can not be natively
94
94
            represented, when pushing to a foreign VCS 
95
95
        """
96
 
        self._config = config
 
96
        self._config_stack = config_stack
97
97
        self._lossy = lossy
98
98
 
99
99
        if committer is None:
100
 
            self._committer = self._config.username()
 
100
            self._committer = self._config_stack.get('email')
101
101
        elif not isinstance(committer, unicode):
102
102
            self._committer = committer.decode() # throw if non-ascii
103
103
        else:
711
711
    def create_bundle(self, target, base, fileobj, format=None):
712
712
        return serializer.write_bundle(self, target, base, fileobj, format)
713
713
 
714
 
    def get_commit_builder(self, branch, parents, config, timestamp=None,
 
714
    def get_commit_builder(self, branch, parents, config_stack, timestamp=None,
715
715
                           timezone=None, committer=None, revprops=None,
716
716
                           revision_id=None, lossy=False):
717
717
        """Obtain a CommitBuilder for this repository.
718
718
 
719
719
        :param branch: Branch to commit to.
720
720
        :param parents: Revision ids of the parents of the new revision.
721
 
        :param config: Configuration to use.
 
721
        :param config_stack: Configuration stack to use.
722
722
        :param timestamp: Optional timestamp recorded for commit.
723
723
        :param timezone: Optional timezone for timestamp.
724
724
        :param committer: Optional committer to set for commit.