Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 4958:9a2a73ea6135
repo locks: use True/False
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 21 Jul 2007 16:02:09 -0500 |
parents | 46e39935ce33 |
children | 97b734fb9c6f |
comparison
equal
deleted
inserted
replaced
4957:46e39935ce33 | 4958:9a2a73ea6135 |
---|---|
559 releasefn, desc=desc) | 559 releasefn, desc=desc) |
560 if acquirefn: | 560 if acquirefn: |
561 acquirefn() | 561 acquirefn() |
562 return l | 562 return l |
563 | 563 |
564 def lock(self, wait=1): | 564 def lock(self, wait=True): |
565 return self._lock(self.sjoin("lock"), wait, None, self.invalidate, | 565 return self._lock(self.sjoin("lock"), wait, None, self.invalidate, |
566 _('repository %s') % self.origroot) | 566 _('repository %s') % self.origroot) |
567 | 567 |
568 def wlock(self, wait=1): | 568 def wlock(self, wait=True): |
569 return self._lock(self.join("wlock"), wait, self.dirstate.write, | 569 return self._lock(self.join("wlock"), wait, self.dirstate.write, |
570 self.dirstate.invalidate, | 570 self.dirstate.invalidate, |
571 _('working directory of %s') % self.origroot) | 571 _('working directory of %s') % self.origroot) |
572 | 572 |
573 def filecommit(self, fn, manifest1, manifest2, linkrev, transaction, changelist): | 573 def filecommit(self, fn, manifest1, manifest2, linkrev, transaction, changelist): |
896 # update dirstate for files that are actually clean | 896 # update dirstate for files that are actually clean |
897 if fixup: | 897 if fixup: |
898 cleanup = False | 898 cleanup = False |
899 if not wlock: | 899 if not wlock: |
900 try: | 900 try: |
901 wlock = self.wlock(wait=0) | 901 wlock = self.wlock(False) |
902 cleanup = True | 902 cleanup = True |
903 except lock.LockException: | 903 except lock.LockException: |
904 pass | 904 pass |
905 if wlock: | 905 if wlock: |
906 for f in fixup: | 906 for f in fixup: |