mercurial/lock.py
changeset 26081 3b6e5914edd8
parent 25956 8cd30e9277ae
child 26082 b188f60bd955
equal deleted inserted replaced
26080:83c9edcac05c 26081:3b6e5914edd8
    81             self.held += 1
    81             self.held += 1
    82             return
    82             return
    83         if lock._host is None:
    83         if lock._host is None:
    84             lock._host = socket.gethostname()
    84             lock._host = socket.gethostname()
    85         lockname = '%s:%s' % (lock._host, self.pid)
    85         lockname = '%s:%s' % (lock._host, self.pid)
    86         while not self.held:
    86         retry = 5
       
    87         while not self.held and retry:
       
    88             retry -= 1
    87             try:
    89             try:
    88                 self.vfs.makelock(lockname, self.f)
    90                 self.vfs.makelock(lockname, self.f)
    89                 self.held = 1
    91                 self.held = 1
    90             except (OSError, IOError) as why:
    92             except (OSError, IOError) as why:
    91                 if why.errno == errno.EEXIST:
    93                 if why.errno == errno.EEXIST: