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
317
320
self.branch.unlock()
319
def _record_inventory(self):
320
"""Store the inventory for the new revision."""
321
inv_text = serializer_v5.write_inventory_to_string(self.new_inv)
322
self.inv_sha1 = sha_string(inv_text)
323
s = self.branch.repository.control_weaves
324
s.add_text('inventory', self.rev_id,
325
split_lines(inv_text), self.present_parents,
326
self.branch.get_transaction())
328
322
def _escape_commit_message(self):
329
323
"""Replace xml-incompatible control characters."""
330
324
# Python strings can include characters that can't be
367
361
def _make_revision(self):
368
362
"""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)
363
rev = Revision(timestamp=self.timestamp,
364
timezone=self.timezone,
365
committer=self.committer,
366
message=self.message,
367
inventory_sha1=self.inv_sha1,
368
revision_id=self.rev_id,
369
properties=self.revprops)
370
rev.parent_ids = self.parents
371
self.branch.repository.add_revision(self.rev_id, rev, self.new_inv, self.config)
387
373
def _remove_deleted(self):
388
374
"""Remove deleted files from the working inventories.