37
37
from bzrlib.trace import mutter
38
38
from bzrlib.progress import ProgressBar
39
from bzrlib.reconcile import RepoReconciler
39
40
from bzrlib.revision import NULL_REVISION
40
41
from bzrlib.symbol_versioning import *
150
151
self.from_repository.revision_store,
154
# fixup inventory if needed:
155
# this is expensive because we have no inverse index to current ghosts.
156
# but on local disk its a few seconds and sftp push is already insane.
158
# FIXME: the generic code path should not need this, if it truely is
160
reconciler = RepoReconciler(self.to_repository)
161
reconciler.reconcile()
154
163
def _fetch_weave_texts(self, revs):
155
164
file_ids = self.from_repository.fileid_involved_by_set(revs)
180
189
def _fetch_inventory_weave(self, revs):
181
190
self.pb.update("inventory fetch", 0, 2)
182
191
from_weave = self.from_repository.get_inventory_weave()
183
to_weave = self.to_repository.get_inventory_weave()
192
self.to_inventory_weave = self.to_repository.get_inventory_weave()
184
193
self.pb.update("inventory fetch", 1, 2)
185
to_weave = self.to_control.get_weave('inventory',
194
self.to_inventory_weave = self.to_control.get_weave('inventory',
186
195
self.to_repository.get_transaction())
187
196
self.pb.update("inventory fetch", 2, 2)
189
if to_weave.numversions() > 0:
198
if self.to_inventory_weave.numversions() > 0:
190
199
# destination has contents, must merge
192
to_weave.join(from_weave, pb=self.pb, msg='merge inventory')
201
self.to_inventory_weave.join(from_weave, pb=self.pb, msg='merge inventory')
193
202
except errors.WeaveParentMismatch:
194
to_weave.reweave(from_weave, pb=self.pb, msg='reweave inventory')
203
self.to_inventory_weave.reweave(from_weave, pb=self.pb, msg='reweave inventory')
196
205
# destination is empty, just replace it
197
to_weave = from_weave.copy()
206
self.to_inventory_weave = from_weave.copy()
199
self.to_control.put_weave('inventory', to_weave,
208
# must be written before pulling any revisions
209
self.to_control.put_weave('inventory', self.to_inventory_weave,
200
210
self.to_repository.get_transaction())