changeset 50895:a834ec41f17c

remotefilelog: use sysstr to check for attribute presence We do not need bytes here.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 30 Aug 2023 13:07:00 +0200
parents f75fd677cc05
children b2b8c25f9462
files hgext/remotefilelog/__init__.py hgext/remotefilelog/remotefilelogserver.py
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/__init__.py	Wed Aug 30 13:02:43 2023 +0200
+++ b/hgext/remotefilelog/__init__.py	Wed Aug 30 13:07:00 2023 +0200
@@ -425,7 +425,7 @@
     finally:
         if opts.get('shallow'):
             for r in repos:
-                if util.safehasattr(r, b'fileservice'):
+                if util.safehasattr(r, 'fileservice'):
                     r.fileservice.close()
 
 
@@ -904,7 +904,7 @@
         if not isenabled(repo):
             continue
 
-        if not util.safehasattr(repo, b'name'):
+        if not util.safehasattr(repo, 'name'):
             ui.warn(
                 _(b"repo %s is a misconfigured remotefilelog repo\n") % path
             )
@@ -1034,7 +1034,7 @@
     bgprefetchrevs = revdatelimit(ui, bgprefetchrevs)
 
     def anon(unused_success):
-        if util.safehasattr(repo, b'ranprefetch') and repo.ranprefetch:
+        if util.safehasattr(repo, 'ranprefetch') and repo.ranprefetch:
             return
         repo.ranprefetch = True
         repo.backgroundprefetch(bgprefetchrevs, repack=bgrepack)
@@ -1080,9 +1080,9 @@
             source, heads=heads, common=common, bundlecaps=bundlecaps, **kwargs
         )
 
-    if util.safehasattr(remote, b'_callstream'):
+    if util.safehasattr(remote, '_callstream'):
         remote._localrepo = repo
-    elif util.safehasattr(remote, b'getbundle'):
+    elif util.safehasattr(remote, 'getbundle'):
         extensions.wrapfunction(remote, 'getbundle', localgetbundle)
 
     return orig(repo, remote, *args, **kwargs)
--- a/hgext/remotefilelog/remotefilelogserver.py	Wed Aug 30 13:02:43 2023 +0200
+++ b/hgext/remotefilelog/remotefilelogserver.py	Wed Aug 30 13:07:00 2023 +0200
@@ -228,7 +228,7 @@
         # When generating file blobs, taking the real path is too slow on large
         # repos, so force it to just return the linkrev directly.
         repo = self._repo
-        if util.safehasattr(repo, b'forcelinkrev') and repo.forcelinkrev:
+        if util.safehasattr(repo, 'forcelinkrev') and repo.forcelinkrev:
             return self._filelog.linkrev(self._filelog.rev(self._filenode))
         return orig(self, *args, **kwargs)