mercurial/scmutil.py
changeset 45847 e0dbfbd4062c
parent 45846 8d72e29ad1e0
child 45857 ae00e170f2d1
equal deleted inserted replaced
45846:8d72e29ad1e0 45847:e0dbfbd4062c
   157             ui.traceback()
   157             ui.traceback()
   158             raise
   158             raise
   159     # Global exception handling, alphabetically
   159     # Global exception handling, alphabetically
   160     # Mercurial-specific first, followed by built-in and library exceptions
   160     # Mercurial-specific first, followed by built-in and library exceptions
   161     except error.LockHeld as inst:
   161     except error.LockHeld as inst:
       
   162         detailed_exit_code = 20
   162         if inst.errno == errno.ETIMEDOUT:
   163         if inst.errno == errno.ETIMEDOUT:
   163             reason = _(b'timed out waiting for lock held by %r') % (
   164             reason = _(b'timed out waiting for lock held by %r') % (
   164                 pycompat.bytestr(inst.locker)
   165                 pycompat.bytestr(inst.locker)
   165             )
   166             )
   166         else:
   167         else:
   170             % (inst.desc or stringutil.forcebytestr(inst.filename), reason)
   171             % (inst.desc or stringutil.forcebytestr(inst.filename), reason)
   171         )
   172         )
   172         if not inst.locker:
   173         if not inst.locker:
   173             ui.error(_(b"(lock might be very busy)\n"))
   174             ui.error(_(b"(lock might be very busy)\n"))
   174     except error.LockUnavailable as inst:
   175     except error.LockUnavailable as inst:
       
   176         detailed_exit_code = 20
   175         ui.error(
   177         ui.error(
   176             _(b"abort: could not lock %s: %s\n")
   178             _(b"abort: could not lock %s: %s\n")
   177             % (
   179             % (
   178                 inst.desc or stringutil.forcebytestr(inst.filename),
   180                 inst.desc or stringutil.forcebytestr(inst.filename),
   179                 encoding.strtolocal(inst.strerror),
   181                 encoding.strtolocal(inst.strerror),