diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py +++ b/hgext/lfs/blobstore.py @@ -271,7 +271,7 @@ def _urlerrorreason(urlerror): if isinstance(urlerror.reason, Exception): inst = urlerror.reason - if util.safehasattr(inst, b'reason'): + if util.safehasattr(inst, 'reason'): try: # usually it is in the form (errno, strerror) reason = inst.reason.args[1] except (AttributeError, IndexError): @@ -751,7 +751,7 @@ def remote(repo, remote=None): if lfsurl is None: if remote: path = remote - elif util.safehasattr(repo, b'_subtoppath'): + elif util.safehasattr(repo, '_subtoppath'): # The pull command sets this during the optional update phase, which # tells exactly where the pull originated, whether 'paths.default' # or explicit. diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py +++ b/hgext/lfs/wrapper.py @@ -72,7 +72,7 @@ def allsupportedversions(orig, ui): def _capabilities(orig, repo, proto): '''Wrap server command to announce lfs server capability''' caps = orig(repo, proto) - if util.safehasattr(repo.svfs, b'lfslocalblobstore'): + if util.safehasattr(repo.svfs, 'lfslocalblobstore'): # Advertise a slightly different capability when lfs is *required*, so # that the client knows it MUST load the extension. If lfs is not # required on the server, there's no reason to autoload the extension @@ -334,7 +334,7 @@ def vfsinit(orig, self, othervfs): self.options[k] = v # also copy lfs blobstores. note: this can run before reposetup, so lfs # blobstore attributes are not always ready at this time. - for name in [b'lfslocalblobstore', b'lfsremoteblobstore']: + for name in ['lfslocalblobstore', 'lfsremoteblobstore']: if util.safehasattr(othervfs, name): setattr(self, name, getattr(othervfs, name)) @@ -342,7 +342,7 @@ def vfsinit(orig, self, othervfs): def _prefetchfiles(repo, revmatches): """Ensure that required LFS blobs are present, fetching them as a group if needed.""" - if not util.safehasattr(repo.svfs, b'lfslocalblobstore'): + if not util.safehasattr(repo.svfs, 'lfslocalblobstore'): return pointers = [] @@ -366,7 +366,7 @@ def _prefetchfiles(repo, revmatches): def _canskipupload(repo): # Skip if this hasn't been passed to reposetup() - if not util.safehasattr(repo.svfs, b'lfsremoteblobstore'): + if not util.safehasattr(repo.svfs, 'lfsremoteblobstore'): return True # if remotestore is a null store, upload is a no-op and can be skipped @@ -375,7 +375,7 @@ def _canskipupload(repo): def candownload(repo): # Skip if this hasn't been passed to reposetup() - if not util.safehasattr(repo.svfs, b'lfsremoteblobstore'): + if not util.safehasattr(repo.svfs, 'lfsremoteblobstore'): return False # if remotestore is a null store, downloads will lead to nothing @@ -524,9 +524,9 @@ def upgradefinishdatamigration(orig, ui, orig(ui, srcrepo, dstrepo, requirements) # Skip if this hasn't been passed to reposetup() - if util.safehasattr( - srcrepo.svfs, b'lfslocalblobstore' - ) and util.safehasattr(dstrepo.svfs, b'lfslocalblobstore'): + if util.safehasattr(srcrepo.svfs, 'lfslocalblobstore') and util.safehasattr( + dstrepo.svfs, 'lfslocalblobstore' + ): srclfsvfs = srcrepo.svfs.lfslocalblobstore.vfs dstlfsvfs = dstrepo.svfs.lfslocalblobstore.vfs