mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
smartlog: be graceful when ancestorcache db is corrupted
Summary: We have seem some errors when closing the database during `db.close()`. This diff nukes the database if that happens. Test Plan: arc unit Reviewers: #mercurial, mjpieters Reviewed By: mjpieters Subscribers: medson, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D5305123 Signature: t1:5305123:1498166056:8355e861c18c670e6342e541f2bc55d65bc7b1c8
This commit is contained in:
parent
9384ed14b8
commit
c35c433212
@ -86,7 +86,11 @@ def ancestorcache(path):
|
||||
yield
|
||||
finally:
|
||||
extensions.unwrapfunction(revlog.revlog, 'ancestor', revlogancestor)
|
||||
db.close()
|
||||
try:
|
||||
db.close()
|
||||
except Exception:
|
||||
# database corruption, we just nuke the database
|
||||
util.tryunlink(path)
|
||||
|
||||
def _drawendinglines(orig, lines, extra, edgemap, seen):
|
||||
# if we are going to have only one single column, draw the missing '|'s
|
||||
|
Loading…
Reference in New Issue
Block a user