equal
deleted
inserted
replaced
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 |