Mercurial > hg
comparison hgext/clonebundles.py @ 50928:d718eddf01d9
safehasattr: drop usage in favor of hasattr
The two functions should now be equivalent at least in their usage in core.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 23:56:15 +0200 |
parents | 335aeb3d670b |
children |
comparison
equal
deleted
inserted
replaced
50927:7a8ea1397816 | 50928:d718eddf01d9 |
---|---|
985 return tr | 985 return tr |
986 | 986 |
987 @localrepo.unfilteredmethod | 987 @localrepo.unfilteredmethod |
988 def clonebundles_lock(self, wait=True): | 988 def clonebundles_lock(self, wait=True): |
989 '''Lock the repository file related to clone bundles''' | 989 '''Lock the repository file related to clone bundles''' |
990 if not util.safehasattr(self, '_cb_lock_ref'): | 990 if not hasattr(self, '_cb_lock_ref'): |
991 self._cb_lock_ref = None | 991 self._cb_lock_ref = None |
992 l = self._currentlock(self._cb_lock_ref) | 992 l = self._currentlock(self._cb_lock_ref) |
993 if l is not None: | 993 if l is not None: |
994 l.lock() | 994 l.lock() |
995 return l | 995 return l |