~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branchbuilder.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-29 22:03:03 UTC
  • mfrom: (5416.2.6 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100929220303-cr95h8iwtggco721
(mbp) Add 'break-lock --force'

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        finally:
104
104
            tree.unlock()
105
105
 
106
 
    def _do_commit(self, tree, message=None, **kwargs):
 
106
    def _do_commit(self, tree, message=None, message_callback=None, **kwargs):
107
107
        reporter = commit.NullCommitReporter()
108
 
        if message is None:
 
108
        if message is None and message_callback is None:
109
109
            message = u'commit %d' % (self._branch.revno() + 1,)
110
 
        return tree.commit(message,
 
110
        return tree.commit(message, message_callback=message_callback,
111
111
            reporter=reporter,
112
112
            **kwargs)
113
113
 
161
161
        self._tree = None
162
162
 
163
163
    def build_snapshot(self, revision_id, parent_ids, actions,
164
 
        message=None, timestamp=None, allow_leftmost_as_ghost=False):
 
164
        message=None, timestamp=None, allow_leftmost_as_ghost=False,
 
165
        committer=None, timezone=None, message_callback=None):
165
166
        """Build a commit, shaped in a specific way.
166
167
 
167
168
        :param revision_id: The handle for the new commit, can be None
174
175
            ('rename', ('orig-path', 'new-path'))
175
176
        :param message: An optional commit message, if not supplied, a default
176
177
            commit message will be written.
 
178
        :param message_callback: A message callback to use for the commit, as
 
179
            per mutabletree.commit.
177
180
        :param timestamp: If non-None, set the timestamp of the commit to this
178
181
            value.
 
182
        :param timezone: An optional timezone for timestamp.
 
183
        :param committer: An optional username to use for commit
179
184
        :param allow_leftmost_as_ghost: True if the leftmost parent should be
180
185
            permitted to be a ghost.
181
186
        :return: The revision_id of the new commit
241
246
            for file_id, content in new_contents.iteritems():
242
247
                tree.put_file_bytes_non_atomic(file_id, content)
243
248
            return self._do_commit(tree, message=message, rev_id=revision_id,
244
 
                timestamp=timestamp)
 
249
                timestamp=timestamp, timezone=timezone, committer=committer,
 
250
                message_callback=message_callback)
245
251
        finally:
246
252
            tree.unlock()
247
253