##// END OF EJS Templates
lfs: use sysstr to check for attribute presence...
marmoute -
r51794:6543469a default
parent child Browse files
Show More
@@ -271,7 +271,7 b' def _urlerrorreason(urlerror):'
271 271 if isinstance(urlerror.reason, Exception):
272 272 inst = urlerror.reason
273 273
274 if util.safehasattr(inst, b'reason'):
274 if util.safehasattr(inst, 'reason'):
275 275 try: # usually it is in the form (errno, strerror)
276 276 reason = inst.reason.args[1]
277 277 except (AttributeError, IndexError):
@@ -751,7 +751,7 b' def remote(repo, remote=None):'
751 751 if lfsurl is None:
752 752 if remote:
753 753 path = remote
754 elif util.safehasattr(repo, b'_subtoppath'):
754 elif util.safehasattr(repo, '_subtoppath'):
755 755 # The pull command sets this during the optional update phase, which
756 756 # tells exactly where the pull originated, whether 'paths.default'
757 757 # or explicit.
@@ -72,7 +72,7 b' def allsupportedversions(orig, ui):'
72 72 def _capabilities(orig, repo, proto):
73 73 '''Wrap server command to announce lfs server capability'''
74 74 caps = orig(repo, proto)
75 if util.safehasattr(repo.svfs, b'lfslocalblobstore'):
75 if util.safehasattr(repo.svfs, 'lfslocalblobstore'):
76 76 # Advertise a slightly different capability when lfs is *required*, so
77 77 # that the client knows it MUST load the extension. If lfs is not
78 78 # required on the server, there's no reason to autoload the extension
@@ -334,7 +334,7 b' def vfsinit(orig, self, othervfs):'
334 334 self.options[k] = v
335 335 # also copy lfs blobstores. note: this can run before reposetup, so lfs
336 336 # blobstore attributes are not always ready at this time.
337 for name in [b'lfslocalblobstore', b'lfsremoteblobstore']:
337 for name in ['lfslocalblobstore', 'lfsremoteblobstore']:
338 338 if util.safehasattr(othervfs, name):
339 339 setattr(self, name, getattr(othervfs, name))
340 340
@@ -342,7 +342,7 b' def vfsinit(orig, self, othervfs):'
342 342 def _prefetchfiles(repo, revmatches):
343 343 """Ensure that required LFS blobs are present, fetching them as a group if
344 344 needed."""
345 if not util.safehasattr(repo.svfs, b'lfslocalblobstore'):
345 if not util.safehasattr(repo.svfs, 'lfslocalblobstore'):
346 346 return
347 347
348 348 pointers = []
@@ -366,7 +366,7 b' def _prefetchfiles(repo, revmatches):'
366 366
367 367 def _canskipupload(repo):
368 368 # Skip if this hasn't been passed to reposetup()
369 if not util.safehasattr(repo.svfs, b'lfsremoteblobstore'):
369 if not util.safehasattr(repo.svfs, 'lfsremoteblobstore'):
370 370 return True
371 371
372 372 # if remotestore is a null store, upload is a no-op and can be skipped
@@ -375,7 +375,7 b' def _canskipupload(repo):'
375 375
376 376 def candownload(repo):
377 377 # Skip if this hasn't been passed to reposetup()
378 if not util.safehasattr(repo.svfs, b'lfsremoteblobstore'):
378 if not util.safehasattr(repo.svfs, 'lfsremoteblobstore'):
379 379 return False
380 380
381 381 # if remotestore is a null store, downloads will lead to nothing
@@ -524,9 +524,9 b' def upgradefinishdatamigration(orig, ui,'
524 524 orig(ui, srcrepo, dstrepo, requirements)
525 525
526 526 # Skip if this hasn't been passed to reposetup()
527 if util.safehasattr(
528 srcrepo.svfs, b'lfslocalblobstore'
529 ) and util.safehasattr(dstrepo.svfs, b'lfslocalblobstore'):
527 if util.safehasattr(srcrepo.svfs, 'lfslocalblobstore') and util.safehasattr(
528 dstrepo.svfs, 'lfslocalblobstore'
529 ):
530 530 srclfsvfs = srcrepo.svfs.lfslocalblobstore.vfs
531 531 dstlfsvfs = dstrepo.svfs.lfslocalblobstore.vfs
532 532
General Comments 0
You need to be logged in to leave comments. Login now