##// 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 546 self.tagscache = None
547 547 self.nodetagscache = None
548 548
549 def do_lock(self, lockname, wait, releasefn=None, acquirefn=None,
550 desc=None):
549 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
551 550 try:
552 551 l = lock.lock(lockname, 0, releasefn, desc=desc)
553 552 except lock.LockHeld, inst:
@@ -563,14 +562,13 b' class localrepository(repo.repository):'
563 562 return l
564 563
565 564 def lock(self, wait=1):
566 return self.do_lock(self.sjoin("lock"), wait,
567 acquirefn=self.invalidate,
568 desc=_('repository %s') % self.origroot)
565 return self._lock(self.sjoin("lock"), wait, None, self.invalidate,
566 _('repository %s') % self.origroot)
569 567
570 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 570 self.dirstate.invalidate,
573 desc=_('working directory of %s') % self.origroot)
571 _('working directory of %s') % self.origroot)
574 572
575 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