201
202
revprops -- Properties for new revision
202
203
:param local: Perform a local only commit.
204
:param recursive: If set to 'down', commit in any subtrees that have
205
pending changes of any sort during this commit.
204
207
mutter('preparing to commit')
233
236
self.rev_id = None
234
237
self.specific_files = specific_files
235
238
self.allow_pointless = allow_pointless
239
self.recursive = recursive
240
self.revprops = revprops
241
self.message_callback = message_callback
242
self.timestamp = timestamp
243
self.timezone = timezone
244
self.committer = committer
245
self.specific_files = specific_files
247
self.verbose = verbose
237
250
if reporter is None and self.reporter is None:
238
251
self.reporter = NullCommitReporter()
282
295
if specific_files is not None:
283
296
# Ensure specified files are versioned
284
297
# (We don't actually need the ids here)
285
tree.find_ids_across_trees(specific_files,
298
# XXX: Dont we have filter_unversioned to do this more
300
tree.find_ids_across_trees(specific_files,
286
301
[self.basis_tree, self.work_tree])
287
302
# one to finish, one for rev and inventory, and one for each
288
303
# inventory entry, and the same for the new inventory.
297
312
raise NotImplementedError('selected-file commit of merges is not supported yet: files %r',
298
313
self.specific_files)
300
self.builder = self.branch.get_commit_builder(self.parents,
315
self.builder = self.branch.get_commit_builder(self.parents,
301
316
self.config, timestamp, timezone, committer, revprops, rev_id)
303
318
self._remove_deleted()
593
608
file_id = new_ie.file_id
595
610
kind = self.work_tree.kind(file_id)
611
if kind == 'tree-reference' and self.recursive == 'down':
612
# nested tree: commit in it
613
sub_tree = WorkingTree.open(self.work_tree.abspath(path))
614
# FIXME: be more comprehensive here:
615
# this works when both trees are in --trees repository,
616
# but when both are bound to a different repository,
617
# it fails; a better way of approaching this is to
618
# finally implement the explicit-caches approach design
619
# a while back - RBC 20070306.
620
if (sub_tree.branch.repository.bzrdir.root_transport.base
622
self.work_tree.branch.repository.bzrdir.root_transport.base):
623
sub_tree.branch.repository = \
624
self.work_tree.branch.repository
626
sub_tree.commit(message=None, revprops=self.revprops,
627
recursive=self.recursive,
628
message_callback=self.message_callback,
629
timestamp=self.timestamp, timezone=self.timezone,
630
committer=self.committer,
631
allow_pointless=self.allow_pointless,
632
strict=self.strict, verbose=self.verbose,
633
local=self.local, reporter=self.reporter)
634
except errors.PointlessCommit:
596
636
if kind != new_ie.kind:
597
637
new_ie = inventory.make_entry(kind, new_ie.name,
598
638
new_ie.parent_id, file_id)