Mercurial > hg
comparison mercurial/tags.py @ 24806:61aea11fb83d stable
tags: do not abort if failed to write lock file to save cache
LockHeld wasn't enough to suppress error during acquiring lock. If .hg directory
is read-only, LockUnavailable will be raised.
$ chmod ugo-w .hg
$ hg identify
abort: could not lock working directory of ...: Permission denied
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 17 Apr 2015 23:22:58 +0900 |
parents | a698e088ad29 |
children | 559f24e3957d |
comparison
equal
deleted
inserted
replaced
24805:82fe57213029 | 24806:61aea11fb83d |
---|---|
500 | 500 |
501 repo = self._repo | 501 repo = self._repo |
502 | 502 |
503 try: | 503 try: |
504 lock = repo.wlock(wait=False) | 504 lock = repo.wlock(wait=False) |
505 except error.LockHeld: | 505 except error.LockError: |
506 repo.ui.log('tagscache', | 506 repo.ui.log('tagscache', |
507 'not writing .hg/%s because lock held\n' % | 507 'not writing .hg/%s because lock cannot be acquired\n' % |
508 (_fnodescachefile)) | 508 (_fnodescachefile)) |
509 return | 509 return |
510 | 510 |
511 try: | 511 try: |
512 try: | 512 try: |