localrepo: remove asserts in _afterlock
authorMatt Mackall <mpm@selenic.com>
Wed, 30 Nov 2011 16:20:07 -0600
changeset 15588 632f4be4d1f3
parent 15587 809d5d30e377
child 15589 cc24e4ed3e0c
localrepo: remove asserts in _afterlock
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Nov 30 15:36:55 2011 -0600
+++ b/mercurial/localrepo.py	Wed Nov 30 16:20:07 2011 -0600
@@ -917,9 +917,8 @@
 
         The callback will be executed on lock release."""
         l = self._lockref and self._lockref()
-        assert l is not None
-        assert l.held
-        l.postreleasehooks.append(callback)
+        if l:
+            l.postreleasehooks.append(callback)
 
     def lock(self, wait=True):
         '''Lock the repository store (.hg/store) and return a weak reference