##// END OF EJS Templates
peer-or-repo: stop relying on AttributeError in `islocal`...
marmoute -
r50583:0d5b2e01 default
parent child Browse files
Show More
@@ -164,10 +164,11 b' def _peerlookup(path):'
164 def islocal(repo):
164 def islocal(repo):
165 '''return true if repo (or path pointing to repo) is local'''
165 '''return true if repo (or path pointing to repo) is local'''
166 if isinstance(repo, bytes):
166 if isinstance(repo, bytes):
167 try:
167 cls = _peerlookup(repo)
168 return _peerlookup(repo).islocal(repo)
168 cls.instance # make sure we load the module
169 except AttributeError:
169 if util.safehasattr(cls, 'islocal'):
170 return False
170 return cls.islocal(repo) # pytype: disable=module-attr
171 return False
171 repo.ui.deprecwarn(b"use obj.local() instead of islocal(obj)", b"6.4")
172 repo.ui.deprecwarn(b"use obj.local() instead of islocal(obj)", b"6.4")
172 return repo.local()
173 return repo.local()
173
174
General Comments 0
You need to be logged in to leave comments. Login now