##// END OF EJS Templates
rename and simplify do_lock
Matt Mackall -
r4913:46e39935 default
parent child Browse files
Show More
@@ -546,8 +546,7 b' class localrepository(repo.repository):'
546 self.tagscache = None
546 self.tagscache = None
547 self.nodetagscache = None
547 self.nodetagscache = None
548
548
549 def do_lock(self, lockname, wait, releasefn=None, acquirefn=None,
549 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
550 desc=None):
551 try:
550 try:
552 l = lock.lock(lockname, 0, releasefn, desc=desc)
551 l = lock.lock(lockname, 0, releasefn, desc=desc)
553 except lock.LockHeld, inst:
552 except lock.LockHeld, inst:
@@ -563,14 +562,13 b' class localrepository(repo.repository):'
563 return l
562 return l
564
563
565 def lock(self, wait=1):
564 def lock(self, wait=1):
566 return self.do_lock(self.sjoin("lock"), wait,
565 return self._lock(self.sjoin("lock"), wait, None, self.invalidate,
567 acquirefn=self.invalidate,
566 _('repository %s') % self.origroot)
568 desc=_('repository %s') % self.origroot)
569
567
570 def wlock(self, wait=1):
568 def wlock(self, wait=1):
571 return self.do_lock(self.join("wlock"), wait, self.dirstate.write,
569 return self._lock(self.join("wlock"), wait, self.dirstate.write,
572 self.dirstate.invalidate,
570 self.dirstate.invalidate,
573 desc=_('working directory of %s') % self.origroot)
571 _('working directory of %s') % self.origroot)
574
572
575 def filecommit(self, fn, manifest1, manifest2, linkrev, transaction, changelist):
573 def filecommit(self, fn, manifest1, manifest2, linkrev, transaction, changelist):
576 """
574 """
General Comments 0
You need to be logged in to leave comments. Login now