3040
3040
self._ensure_real()
3041
3041
return self._real_branch.set_push_location(location)
3043
def heads_to_fetch(self, stop_revision=None, include_tags=True):
3043
def heads_to_fetch(self, stop_revision=None):
3044
3044
if self._format._use_default_local_heads_to_fetch():
3045
3045
# We recognise this format, and its heads-to-fetch implementation
3046
3046
# is the default one (tip + tags). In this case it's cheaper to
3047
3047
# just use the default implementation rather than a special RPC as
3048
3048
# the tip and tags data is cached.
3049
return branch.Branch.heads_to_fetch(self, stop_revision,
3049
return branch.Branch.heads_to_fetch(self, stop_revision)
3051
3050
medium = self._client._medium
3052
3051
if medium._is_remote_before((2, 4)):
3053
return self._vfs_heads_to_fetch(stop_revision, include_tags)
3052
return self._vfs_heads_to_fetch(stop_revision)
3055
return self._rpc_heads_to_fetch(stop_revision, include_tags)
3054
return self._rpc_heads_to_fetch(stop_revision)
3056
3055
except errors.UnknownSmartMethod:
3057
3056
medium._remember_remote_is_before((2, 4))
3058
return self._vfs_heads_to_fetch(stop_revision, include_tags)
3057
return self._vfs_heads_to_fetch(stop_revision)
3060
def _rpc_heads_to_fetch(self, stop_revision, include_tags):
3059
def _rpc_heads_to_fetch(self, stop_revision):
3061
3060
response = self._call('Branch.heads_to_fetch', self._remote_path(),
3062
stop_revision, include_tags)
3063
3062
if len(response) != 2:
3064
3063
raise errors.UnexpectedSmartServerResponse(response)
3065
3064
must_fetch, if_present_fetch = response
3066
3065
return set(must_fetch), set(if_present_fetch)
3068
def _vfs_heads_to_fetch(self, stop_revision, include_tags):
3067
def _vfs_heads_to_fetch(self, stop_revision):
3069
3068
self._ensure_real()
3070
return self._real_branch.heads_to_fetch(stop_revision, include_tags)
3069
return self._real_branch.heads_to_fetch(stop_revision)
3073
3072
class RemoteConfig(object):