It does reflect a real bug, and it's a bit comical:
def _get_tags_bytes(self): medium = self._client._medium if medium._is_remote_before((1, 13)): return self._vfs_get_tags_bytes() try: response = self._call('Branch.get_tags_bytes', self._remote_path()) except errors.UnknownSmartMethod: medium._remember_remote_is_before((1, 13)) return self._vfs_get_tags_bytes() return response[0]
def _vfs_set_tags_bytes(self, bytes): self._ensure_real() return self._real_branch._set_tags_bytes(bytes)
def _set_tags_bytes(self, bytes): medium = self._client._medium if medium._is_remote_before((1, 18)): self._vfs_set_tags_bytes(bytes) try: args = ( self._remote_path(), self._lock_token, self._repo_lock_token) response = self._call_with_body_bytes( 'Branch.set_tags_bytes', args, bytes) except errors.UnknownSmartMethod: medium._remember_remote_is_before((1, 18)) self._vfs_set_tags_bytes(bytes)
If the server doesn't support it, we do it over vfs and then try again by rpc.
So it's good the assertion caught this, but I also think it's a bit bad there's repeated code to do:
if server older than X: do old method else: try it except not supported: server_is_older_than X
It does reflect a real bug, and it's a bit comical:
def _get_tags_ bytes(self) : _medium _is_remote_ before( (1, 13)): get_tags_ bytes()
response = self._call( 'Branch. get_tags_ bytes', self._remote_ path()) UnknownSmartMet hod:
medium. _remember_ remote_ is_before( (1, 13)) get_tags_ bytes()
medium = self._client.
if medium.
return self._vfs_
try:
except errors.
return self._vfs_
return response[0]
def _vfs_set_ tags_bytes( self, bytes):
self._ ensure_ real() branch. _set_tags_ bytes(bytes)
return self._real_
def _set_tags_ bytes(self, bytes): _medium _is_remote_ before( (1, 18)):
self. _vfs_set_ tags_bytes( bytes)
self. _remote_ path(), self._lock_token, self._repo_ lock_token)
response = self._call_ with_body_ bytes(
'Branch. set_tags_ bytes', args, bytes) UnknownSmartMet hod:
medium. _remember_ remote_ is_before( (1, 18))
self. _vfs_set_ tags_bytes( bytes)
medium = self._client.
if medium.
try:
args = (
except errors.
If the server doesn't support it, we do it over vfs and then try again by rpc.
So it's good the assertion caught this, but I also think it's a bit bad there's repeated code to do:
if server older than X: is_older_ than X
do old method
else:
try it
except not supported:
server_