176
176
# not reference anything, and its cheap enough
177
177
to_weave.join(from_weave)
179
# destination is empty, just replace it
179
# destination is empty, just copy it.
180
# this copies all the texts, which is useful and
181
# on per-file basis quite cheap.
182
child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
181
child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
182
184
from_repo = self.from_repository
183
185
from_transaction = from_repo.get_transaction()
184
186
to_transaction = self.to_repository.get_transaction()
200
202
child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
202
if to_weave.num_versions() > 0:
203
# destination has contents, must merge
204
pb.update("inventory fetch", 1, 3)
205
from_weave = self.from_repository.get_inventory_weave()
206
pb.update("inventory fetch", 2, 3)
207
# we fetch only the referenced inventories because we do not
208
# know for unselected inventories whether all their required
209
# texts are present in the other repository - it could be
211
to_weave.join(from_weave, pb=child_pb,
212
msg='merge inventory', version_ids=revs)
214
# destination is empty, just replace it
215
from_transaction = self.from_repository.get_transaction()
216
to_transaction = self.to_repository.get_transaction()
217
self.to_control.copy_multi(self.from_control,
204
# just merge, this is optimisable and its means we dont
205
# copy unreferenced data such as not-needed inventories.
206
pb.update("inventory fetch", 1, 3)
207
from_weave = self.from_repository.get_inventory_weave()
208
pb.update("inventory fetch", 2, 3)
209
# we fetch only the referenced inventories because we do not
210
# know for unselected inventories whether all their required
211
# texts are present in the other repository - it could be
213
to_weave.join(from_weave, pb=child_pb, msg='merge inventory',
223
216
child_pb.finished()
260
253
# but on local disk its a few seconds and sftp push is already insane.
261
254
# so we just-do-it.
262
255
# FIXME: repository should inform if this is needed.
263
reconciler = RepoReconciler(self.to_repository)
264
reconciler.reconcile()
256
self.to_repository.reconcile()
267
259
class KnitRepoFetcher(RepoFetcher):