mercurial/localrepo.py
branchstable
changeset 24821 57f1dbc99631
parent 24799 d99d7e3f5cda
child 24824 0325c0da05df
equal deleted inserted replaced
24820:6a6b69d9e539 24821:57f1dbc99631
  1192         if acquirefn:
  1192         if acquirefn:
  1193             acquirefn()
  1193             acquirefn()
  1194         return l
  1194         return l
  1195 
  1195 
  1196     def _afterlock(self, callback):
  1196     def _afterlock(self, callback):
  1197         """add a callback to the current repository lock.
  1197         """add a callback to be run when the repository is fully unlocked
  1198 
  1198 
  1199         The callback will be executed on lock release."""
  1199         The callback will be executed when the outermost lock is released
  1200         l = self._lockref and self._lockref()
  1200         (with wlock being higher level than 'lock')."""
  1201         if l:
  1201         for ref in (self._wlockref, self._lockref):
  1202             l.postrelease.append(callback)
  1202             l = ref and ref()
  1203         else:
  1203             if l and l.held:
       
  1204                 l.postrelease.append(callback)
       
  1205                 break
       
  1206         else: # no lock have been found.
  1204             callback()
  1207             callback()
  1205 
  1208 
  1206     def lock(self, wait=True):
  1209     def lock(self, wait=True):
  1207         '''Lock the repository store (.hg/store) and return a weak reference
  1210         '''Lock the repository store (.hg/store) and return a weak reference
  1208         to the lock. Use this before modifying the store (e.g. committing or
  1211         to the lock. Use this before modifying the store (e.g. committing or