Mercurial > hg
comparison mercurial/lock.py @ 705:574869103985
Merge with TAH
manifest hash: 197e0d1a0d7376a9eb72381330462f06490ab821
author | mpm@selenic.com |
---|---|
date | Thu, 14 Jul 2005 22:56:55 -0800 |
parents | 03f27b1381f9 5ca319a641e1 |
children | 6d5a62a549fa |
comparison
equal
deleted
inserted
replaced
694:51eb248d3348 | 705:574869103985 |
---|---|
35 def trylock(self): | 35 def trylock(self): |
36 pid = os.getpid() | 36 pid = os.getpid() |
37 try: | 37 try: |
38 util.makelock(str(pid), self.f) | 38 util.makelock(str(pid), self.f) |
39 self.held = 1 | 39 self.held = 1 |
40 except: | 40 except (OSError, IOError): |
41 raise LockHeld(util.readlock(self.f)) | 41 raise LockHeld(util.readlock(self.f)) |
42 | 42 |
43 def release(self): | 43 def release(self): |
44 if self.held: | 44 if self.held: |
45 self.held = 0 | 45 self.held = 0 |