78
78
from bzrlib.revision import Revision
79
79
from bzrlib.trace import mutter, note, warning
80
80
from bzrlib.xml5 import serializer_v5
81
from bzrlib.inventory import Inventory
81
from bzrlib.inventory import Inventory, ROOT_ID
82
82
from bzrlib.weave import Weave
83
83
from bzrlib.weavefile import read_weave, write_weave_v5
84
84
from bzrlib.atomicfile import AtomicFile
358
358
if self.specific_files:
359
359
if not is_inside_any(self.specific_files, path):
360
360
mutter('%s not selected for commit', path)
361
self._carry_file(file_id)
361
self._carry_entry(file_id)
364
# this is selected, ensure its parents are too.
365
parent_id = new_ie.parent_id
366
while parent_id != ROOT_ID:
367
if not self.new_inv.has_id(parent_id):
368
ie = self._select_entry(self.work_inv[parent_id])
369
mutter('%s selected for commit because of %s',
370
self.new_inv.id2path(parent_id), path)
372
ie = self.new_inv[parent_id]
373
if ie.revision is not None:
375
mutter('%s selected for commit because of %s',
376
self.new_inv.id2path(parent_id), path)
377
parent_id = ie.parent_id
363
378
mutter('%s selected for commit', path)
368
def _carry_file(self, file_id):
379
self._select_entry(new_ie)
381
def _select_entry(self, new_ie):
382
"""Make new_ie be considered for committing."""
388
def _carry_entry(self, file_id):
369
389
"""Carry the file unchanged from the basis revision."""
370
390
if self.basis_inv.has_id(file_id):
371
391
self.new_inv.add(self.basis_inv[file_id].copy())