##// END OF EJS Templates
lock: change name of release chain
Matt Mackall -
r15589:cc24e4ed default
parent child Browse files
Show More
@@ -918,7 +918,7 b' class localrepository(repo.repository):'
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 if l:
920 if l:
921 l.postreleasehooks.append(callback)
921 l.postrelease.append(callback)
922
922
923 def lock(self, wait=True):
923 def lock(self, wait=True):
924 '''Lock the repository store (.hg/store) and return a weak reference
924 '''Lock the repository store (.hg/store) and return a weak reference
@@ -35,7 +35,7 b' class lock(object):'
35 self.timeout = timeout
35 self.timeout = timeout
36 self.releasefn = releasefn
36 self.releasefn = releasefn
37 self.desc = desc
37 self.desc = desc
38 self.postreleasehooks = []
38 self.postrelease = []
39 self.lock()
39 self.lock()
40
40
41 def __del__(self):
41 def __del__(self):
@@ -134,11 +134,10 b' class lock(object):'
134 util.unlink(self.f)
134 util.unlink(self.f)
135 except OSError:
135 except OSError:
136 pass
136 pass
137 for callback in self.postreleasehooks:
137 for callback in self.postrelease:
138 callback()
138 callback()
139
139
140 def release(*locks):
140 def release(*locks):
141 for lock in locks:
141 for lock in locks:
142 if lock is not None:
142 if lock is not None:
143 lock.release()
143 lock.release()
144
General Comments 0
You need to be logged in to leave comments. Login now