3299
3299
return basis_id, basis_tree
3302
class InterOtherToRemote(InterRepository):
3303
"""An InterRepository that simply delegates to the 'real' InterRepository
3304
calculated for (source, target._real_repository).
3307
def __init__(self, source, target):
3308
InterRepository.__init__(self, source, target)
3309
self._real_inter = None
3312
def is_compatible(source, target):
3313
if isinstance(target, remote.RemoteRepository):
3317
def _ensure_real_inter(self):
3318
if self._real_inter is None:
3319
self.target._ensure_real()
3320
real_target = self.target._real_repository
3321
self._real_inter = InterRepository.get(self.source, real_target)
3322
# Make _real_inter use the RemoteRepository for get_parent_map
3323
self._real_inter.target_get_graph = self.target.get_graph
3324
self._real_inter.target_get_parent_map = self.target.get_parent_map
3326
def copy_content(self, revision_id=None):
3327
self._ensure_real_inter()
3328
self._real_inter.copy_content(revision_id=revision_id)
3330
def fetch(self, revision_id=None, pb=None, find_ghosts=False,
3332
self._ensure_real_inter()
3333
return self._real_inter.fetch(revision_id=revision_id, pb=pb,
3334
find_ghosts=find_ghosts, fetch_spec=fetch_spec)
3337
def _get_repo_format_to_test(self):
3341
class InterRemoteToOther(InterRepository):
3343
def __init__(self, source, target):
3344
InterRepository.__init__(self, source, target)
3345
self._real_inter = None
3348
def is_compatible(source, target):
3349
if not isinstance(source, remote.RemoteRepository):
3351
return InterRepository._same_model(source, target)
3353
def _ensure_real_inter(self):
3354
if self._real_inter is None:
3355
self.source._ensure_real()
3356
real_source = self.source._real_repository
3357
self._real_inter = InterRepository.get(real_source, self.target)
3359
def copy_content(self, revision_id=None):
3360
self._ensure_real_inter()
3361
self._real_inter.copy_content(revision_id=revision_id)
3364
def _get_repo_format_to_test(self):
3369
3302
class InterPackToRemotePack(InterPackRepo):
3370
3303
"""A specialisation of InterPackRepo for a target that is a
3371
3304
RemoteRepository.