/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Merge from bzr.ab.integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
                    # not reference anything, and its cheap enough
177
177
                    to_weave.join(from_weave)
178
178
                else:
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()
180
183
                    try:
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()
199
201
 
200
202
            child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
201
203
            try:
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
210
 
                    # corrupt.
211
 
                    to_weave.join(from_weave, pb=child_pb, 
212
 
                                  msg='merge inventory', version_ids=revs)
213
 
                else:
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,
218
 
                                               ['inventory'],
219
 
                                               child_pb,
220
 
                                               from_transaction,
221
 
                                               to_transaction)
 
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
 
212
                # corrupt.
 
213
                to_weave.join(from_weave, pb=child_pb, msg='merge inventory',
 
214
                              version_ids=revs)
222
215
            finally:
223
216
                child_pb.finished()
224
217
        finally:
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()
265
257
    
266
258
 
267
259
class KnitRepoFetcher(RepoFetcher):
286
278
        from_rf = self.from_repository._revision_store.get_revision_file(
287
279
            from_transaction)
288
280
        to_rf.join(from_rf, version_ids=revs, pb=self.pb)
289
 
        reconciler = RepoReconciler(self.to_repository)
290
 
        reconciler.reconcile()
291
281
 
292
282
 
293
283
class Fetcher(object):