76
76
from bzrlib.osutils import (local_time_offset,
77
77
rand_bytes, compact_date,
78
78
kind_marker, is_inside_any, quotefn,
79
sha_string, sha_strings, sha_file, isdir, isfile,
79
sha_file, isdir, isfile,
81
81
import bzrlib.config
82
82
import bzrlib.errors as errors
315
318
self.branch.unlock()
317
def _record_inventory(self):
318
"""Store the inventory for the new revision."""
319
inv_text = serializer_v5.write_inventory_to_string(self.new_inv)
320
self.inv_sha1 = sha_string(inv_text)
321
s = self.branch.repository.control_weaves
322
inv_versioned_file = s.get_weave('inventory',
323
self.branch.repository.get_transaction())
324
inv_versioned_file.add_lines(self.rev_id,
325
self.present_parents,
326
split_lines(inv_text))
328
320
def _escape_commit_message(self):
329
321
"""Replace xml-incompatible control characters."""
330
322
# Python strings can include characters that can't be
367
359
def _make_revision(self):
368
360
"""Record a new revision object for this commit."""
369
self.rev = Revision(timestamp=self.timestamp,
370
timezone=self.timezone,
371
committer=self.committer,
372
message=self.message,
373
inventory_sha1=self.inv_sha1,
374
revision_id=self.rev_id,
375
properties=self.revprops)
376
self.rev.parent_ids = self.parents
378
serializer_v5.write_revision(self.rev, rev_tmp)
380
if self.config.signature_needed():
381
plaintext = Testament(self.rev, self.new_inv).as_short_text()
382
self.branch.repository.store_revision_signature(
383
gpg.GPGStrategy(self.config), plaintext, self.rev_id)
384
self.branch.repository.revision_store.add(rev_tmp, self.rev_id)
385
mutter('new revision_id is {%s}', self.rev_id)
361
rev = Revision(timestamp=self.timestamp,
362
timezone=self.timezone,
363
committer=self.committer,
364
message=self.message,
365
inventory_sha1=self.inv_sha1,
366
revision_id=self.rev_id,
367
properties=self.revprops)
368
rev.parent_ids = self.parents
369
self.branch.repository.add_revision(self.rev_id, rev, self.new_inv, self.config)
387
371
def _remove_deleted(self):
388
372
"""Remove deleted files from the working inventories.