3052
3052
self._ensure_real()
3053
3053
return self._real_branch.set_push_location(location)
3055
def heads_to_fetch(self, stop_revision=None):
3055
def heads_to_fetch(self):
3056
3056
if self._format._use_default_local_heads_to_fetch():
3057
3057
# We recognise this format, and its heads-to-fetch implementation
3058
3058
# is the default one (tip + tags). In this case it's cheaper to
3059
3059
# just use the default implementation rather than a special RPC as
3060
3060
# the tip and tags data is cached.
3061
return branch.Branch.heads_to_fetch(self, stop_revision)
3061
return branch.Branch.heads_to_fetch(self)
3062
3062
medium = self._client._medium
3063
3063
if medium._is_remote_before((2, 4)):
3064
return self._vfs_heads_to_fetch(stop_revision)
3064
return self._vfs_heads_to_fetch()
3066
return self._rpc_heads_to_fetch(stop_revision)
3066
return self._rpc_heads_to_fetch()
3067
3067
except errors.UnknownSmartMethod:
3068
3068
medium._remember_remote_is_before((2, 4))
3069
return self._vfs_heads_to_fetch(stop_revision)
3069
return self._vfs_heads_to_fetch()
3071
def _rpc_heads_to_fetch(self, stop_revision):
3072
response = self._call('Branch.heads_to_fetch', self._remote_path(),
3071
def _rpc_heads_to_fetch(self):
3072
response = self._call('Branch.heads_to_fetch', self._remote_path())
3074
3073
if len(response) != 2:
3075
3074
raise errors.UnexpectedSmartServerResponse(response)
3076
3075
must_fetch, if_present_fetch = response
3077
3076
return set(must_fetch), set(if_present_fetch)
3079
def _vfs_heads_to_fetch(self, stop_revision):
3078
def _vfs_heads_to_fetch(self):
3080
3079
self._ensure_real()
3081
return self._real_branch.heads_to_fetch(stop_revision)
3080
return self._real_branch.heads_to_fetch()
3084
3083
class RemoteConfig(object):