mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
smartlog: use dbm implementation, available on the system
Summary: `gdbm` is unavailable on Windows. Python provides module called `anydbm` which abstracts the implementation of `dbm` and is even capable of using a dump Python-only implementation if nothing is installed. Test Plan: - rt Reviewers: #sourcecontrol Differential Revision: https://phabricator.intern.facebook.com/D5154620
This commit is contained in:
parent
355573a423
commit
44cd7a5717
@ -26,7 +26,7 @@ to the user.
|
||||
from __future__ import absolute_import
|
||||
|
||||
import contextlib
|
||||
import gdbm
|
||||
import anydbm
|
||||
from itertools import chain
|
||||
import re
|
||||
|
||||
@ -67,8 +67,8 @@ logopts = [opt for opt in commands.logopts if opt[1] != "limit"]
|
||||
def ancestorcache(path):
|
||||
# simple cache to speed up revlog.ancestors
|
||||
try:
|
||||
db = gdbm.open(path, 'c')
|
||||
except gdbm.error:
|
||||
db = anydbm.open(path, 'c')
|
||||
except anydbm.error:
|
||||
# database locked, fail gracefully
|
||||
yield
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user