22
22
import bzrlib.errors as errors
23
from bzrlib.errors import InstallFailed, NoSuchRevision, WeaveError
23
from bzrlib.errors import (InstallFailed, NoSuchRevision, WeaveError,
24
25
from bzrlib.trace import mutter, note, warning
25
26
from bzrlib.branch import Branch
26
27
from bzrlib.progress import ProgressBar
212
213
# in memory until everything's done? But this way is nicer
213
214
# if it's interrupted.
214
215
for path, ie in inv.iter_entries():
215
if ie.revision != rev_id:
217
mutter('%s {%s} is changed in this revision',
219
self._copy_one_weave(rev_id, ie.file_id)
216
self._copy_one_weave(rev_id, ie.file_id, ie.revision)
221
def _copy_one_weave(self, rev_id, file_id):
222
"""Copy one file weave."""
223
mutter('copy file {%s} modified in {%s}', file_id, rev_id)
224
if file_id in self.copied_file_ids:
225
mutter('file {%s} already copied', file_id)
218
def _copy_one_weave(self, rev_id, file_id, text_revision):
219
"""Copy one file weave, esuring the result contains text_revision."""
220
to_weave = self.to_weaves.get_weave_or_empty(file_id,
221
self.to_branch.get_transaction())
222
if text_revision in to_weave:
227
224
from_weave = self.from_weaves.get_weave(file_id,
228
225
self.from_branch.get_transaction())
229
to_weave = self.to_weaves.get_weave_or_empty(file_id,
230
self.to_branch.get_transaction())
226
if text_revision not in from_weave:
227
raise MissingText(self.from_branch, text_revision, file_id)
228
mutter('copy file {%s} modified in {%s}', file_id, rev_id)
232
230
to_weave.join(from_weave)
233
231
except errors.WeaveParentMismatch: