comparison mercurial/localrepo.py @ 15588:632f4be4d1f3

localrepo: remove asserts in _afterlock
author Matt Mackall <mpm@selenic.com>
date Wed, 30 Nov 2011 16:20:07 -0600
parents 809d5d30e377
children cc24e4ed3e0c
comparison
equal deleted inserted replaced
15587:809d5d30e377 15588:632f4be4d1f3
915 def _afterlock(self, callback): 915 def _afterlock(self, callback):
916 """add a callback to the current repository lock. 916 """add a callback to the current repository lock.
917 917
918 The callback will be executed on lock release.""" 918 The callback will be executed on lock release."""
919 l = self._lockref and self._lockref() 919 l = self._lockref and self._lockref()
920 assert l is not None 920 if l:
921 assert l.held 921 l.postreleasehooks.append(callback)
922 l.postreleasehooks.append(callback)
923 922
924 def lock(self, wait=True): 923 def lock(self, wait=True):
925 '''Lock the repository store (.hg/store) and return a weak reference 924 '''Lock the repository store (.hg/store) and return a weak reference
926 to the lock. Use this before modifying the store (e.g. committing or 925 to the lock. Use this before modifying the store (e.g. committing or
927 stripping). If you are opening a transaction, get a lock as well.)''' 926 stripping). If you are opening a transaction, get a lock as well.)'''