678
680
return self._real_repository.get_missing_parent_inventories(
679
681
check_for_missing_texts=check_for_missing_texts)
681
def _get_rev_id_for_revno_vfs(self, revno, known_pair):
683
return self._real_repository.get_rev_id_for_revno(
686
def get_rev_id_for_revno(self, revno, known_pair):
687
"""See Repository.get_rev_id_for_revno."""
688
path = self.bzrdir._path_for_remote_call(self._client)
690
if self._client._medium._is_remote_before((1, 17)):
691
return self._get_rev_id_for_revno_vfs(revno, known_pair)
692
response = self._call(
693
'Repository.get_rev_id_for_revno', path, revno, known_pair)
694
except errors.UnknownSmartMethod:
695
self._client._medium._remember_remote_is_before((1, 17))
696
return self._get_rev_id_for_revno_vfs(revno, known_pair)
697
if response[0] == 'ok':
698
return True, response[1]
699
elif response[0] == 'history-incomplete':
700
known_pair = response[1:3]
701
for fallback in self._fallback_repositories:
702
found, result = fallback.get_rev_id_for_revno(revno, known_pair)
707
# Not found in any fallbacks
708
return False, known_pair
710
raise errors.UnexpectedSmartServerResponse(response)
712
683
def _ensure_real(self):
713
684
"""Ensure that there is a _real_repository set.
1929
1900
self._ensure_real()
1930
1901
return self._custom_format.supports_stacking()
1932
def supports_set_append_revisions_only(self):
1934
return self._custom_format.supports_set_append_revisions_only()
1937
1904
class RemoteBranch(branch.Branch, _RpcHelper):
1938
1905
"""Branch stored on a server accessed by HPSS RPC.
1957
1924
# We intentionally don't call the parent class's __init__, because it
1958
1925
# will try to assign to self.tags, which is a property in this subclass.
1959
1926
# And the parent's __init__ doesn't do much anyway.
1927
self._revision_id_to_revno_cache = None
1928
self._partial_revision_id_to_revno_cache = {}
1929
self._revision_history_cache = None
1930
self._last_revision_info_cache = None
1931
self._merge_sorted_revisions_cache = None
1960
1932
self.bzrdir = remote_bzrdir
1961
1933
if _client is not None:
1962
1934
self._client = _client
2263
2234
raise NotImplementedError(self.dont_leave_lock_in_place)
2264
2235
self._leave_lock = False
2266
def get_rev_id(self, revno, history=None):
2268
return _mod_revision.NULL_REVISION
2269
last_revision_info = self.last_revision_info()
2270
ok, result = self.repository.get_rev_id_for_revno(
2271
revno, last_revision_info)
2274
missing_parent = result[1]
2275
# Either the revision named by the server is missing, or its parent
2276
# is. Call get_parent_map to determine which, so that we report a
2278
parent_map = self.repository.get_parent_map([missing_parent])
2279
if missing_parent in parent_map:
2280
missing_parent = parent_map[missing_parent]
2281
raise errors.RevisionNotPresent(missing_parent, self.repository)
2283
2237
def _last_revision_info(self):
2284
2238
response = self._call('Branch.last_revision_info', self._remote_path())
2285
2239
if response[0] != 'ok':