146
146
except errors.NoSuchRevision:
147
147
raise InstallFailed([self._last_revision])
149
def _fetch_revision_texts(self, revs):
150
self.to_repository.revision_store.copy_multi(
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()
163
149
def _fetch_weave_texts(self, revs):
164
150
file_ids = self.from_repository.fileid_involved_by_set(revs)
191
class GenericRepoFetcher(RepoFetcher):
192
"""This is a generic repo to repo fetcher.
194
This makes minimal assumptions about repo layout and contents.
195
It triggers a reconciliation after fetching to ensure integrity.
198
def _fetch_revision_texts(self, revs):
199
self.to_transaction = self.to_repository.get_transaction()
203
self.pb.update('copying revisions', count, total)
205
sig_text = self.from_repository.get_signature_text(rev)
206
self.to_repository._revision_store.add_revision_signature_text(
207
rev, sig_text, self.to_transaction)
208
except errors.NoSuchRevision:
211
self.to_repository._revision_store.add_revision(
212
self.from_repository.get_revision(rev),
215
self.pb.update('copying revisions', count, total)
216
# fixup inventory if needed:
217
# this is expensive because we have no inverse index to current ghosts.
218
# but on local disk its a few seconds and sftp push is already insane.
220
# FIXME: repository should inform if this is needed.
221
reconciler = RepoReconciler(self.to_repository)
222
reconciler.reconcile()
225
class KnitRepoFetcher(RepoFetcher):
226
"""This is a knit format repository specific fetcher.
228
This differs from the GenericRepoFetcher by not doing a
229
reconciliation after copying, and using knit joining to
233
def _fetch_revision_texts(self, revs):
234
# may need to be a InterRevisionStore call here.
235
from_transaction = self.from_repository.get_transaction()
236
to_transaction = self.to_repository.get_transaction()
237
to_sf = self.to_repository._revision_store._get_signature_file(
239
from_sf = self.from_repository._revision_store._get_signature_file(
241
to_sf.join(from_sf, version_ids=revs, pb=self.pb, ignore_missing=True)
242
to_rf = self.to_repository._revision_store.get_revision_file(
244
from_rf = self.from_repository._revision_store.get_revision_file(
246
to_rf.join(from_rf, version_ids=revs, pb=self.pb)
247
reconciler = RepoReconciler(self.to_repository)
248
reconciler.reconcile()
205
251
class Fetcher(object):
206
252
"""Backwards compatability glue for branch.fetch()."""