163
163
for file_id in file_ids:
164
164
texts_pb.update("fetch texts", count, num_file_ids)
167
to_weave = self.to_weaves.get_weave(file_id,
168
self.to_repository.get_transaction())
169
except errors.NoSuchFile:
170
# destination is empty, just copy it.
171
# this copies all the texts, which is useful and
172
# on per-file basis quite cheap.
173
self.to_weaves.copy_multi(
177
self.from_repository.get_transaction(),
178
self.to_repository.get_transaction())
180
# destination has contents, must merge
181
from_weave = self.from_weaves.get_weave(file_id,
182
self.from_repository.get_transaction())
183
# we fetch all the texts, because texts do
184
# not reference anything, and its cheap enough
185
to_weave.join(from_weave)
166
to_weave = self.to_weaves.get_weave_or_empty(file_id,
167
self.to_repository.get_transaction())
168
from_weave = self.from_weaves.get_weave(file_id,
169
self.from_repository.get_transaction())
170
# we fetch all the texts, because texts do
171
# not reference anything, and its cheap enough
172
to_weave.join(from_weave)
187
174
texts_pb.finished()