fastmanifest: fix import paths

This commit is contained in:
Durham Goode 2018-01-09 15:23:52 -08:00
parent 55eddfbd07
commit b805623673
9 changed files with 13 additions and 12 deletions

View File

@ -93,6 +93,7 @@ is not normally accessible to manifests.
manifests to the cache and manipulate what is cached. It allows caching fast
and flat manifest, asynchronously and synchronously.
'''
from __future__ import absolute_import
import sys

View File

@ -4,6 +4,7 @@
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import os
import errno
@ -18,8 +19,7 @@ from mercurial import (
)
from hgext.extlib import cfastmanifest
from . import concurrency
from . import constants
from . import constants, concurrency
from .metrics import metricscollector
from .implementation import fastmanifestcache, CacheFullException

View File

@ -4,6 +4,7 @@
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import errno
import os

View File

@ -6,6 +6,8 @@
# GNU General Public License version 2 or any later version.
# fastmanifests are cached in .hg/store/<CACHE_SUBDIR>
from __future__ import absolute_import
CACHE_SUBDIR = "manifestcache"
# See _systemawarecachelimit in cachemanager

View File

@ -4,6 +4,7 @@
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
class manifestaccesslogger(object):
"""Class to log manifest access and confirm our assumptions"""

View File

@ -4,6 +4,7 @@
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import collections
import os
@ -17,7 +18,6 @@ from mercurial import (
revlog,
util,
)
from . import cachemanager
from hgext.extlib import cfastmanifest
from .metrics import metricscollector
from .constants import (
@ -719,6 +719,8 @@ class fastmanifestcache(object):
@staticmethod
def getinstance(opener, ui):
if not util.safehasattr(opener, 'fastmanifestcache'):
# Avoid circular imports
from . import cachemanager
limit = cachemanager._systemawarecachelimit(opener=opener, ui=ui)
opener.fastmanifestcache = fastmanifestcache(opener, ui, limit)
return opener.fastmanifestcache

View File

@ -22,6 +22,7 @@
# To debug metrics use fastmanifest.debugmetrics = True, this will print
# the metrics collected for each command with ui.status at the end of each
# command.
from __future__ import absolute_import
FASTMANIFEST_DONOTREPORT_METRICS = set([
"cachehit",

View File

@ -66,13 +66,6 @@
hgext/fastannotate/formatter.py not using absolute_import
hgext/fastannotate/protocol.py not using absolute_import
hgext/fastlog.py not using absolute_import
hgext/fastmanifest/__init__.py not using absolute_import
hgext/fastmanifest/cachemanager.py not using absolute_import
hgext/fastmanifest/concurrency.py not using absolute_import
hgext/fastmanifest/constants.py not using absolute_import
hgext/fastmanifest/debug.py not using absolute_import
hgext/fastmanifest/implementation.py not using absolute_import
hgext/fastmanifest/metrics.py not using absolute_import
hgext/fastpartialmatch.py not using absolute_import
hgext/fbconduit.py not using absolute_import
hgext/fbhistedit.py not using absolute_import

View File

@ -76,7 +76,7 @@ class HybridManifest(unittest.TestCase):
"%s missing in hybrid manifest" % method
def test_cachelimit(self):
from fastmanifest.cachemanager import _systemawarecachelimit
from hgext.fastmanifest.cachemanager import _systemawarecachelimit
cachealloc = _systemawarecachelimit.cacheallocation
GB = fastmanifest.cachemanager.GB
MB = fastmanifest.cachemanager.MB
@ -175,5 +175,5 @@ class HybridManifest(unittest.TestCase):
if __name__ == "__main__":
sys.path.insert(0, os.path.join(os.environ["TESTDIR"], ".."))
import fastmanifest
from hgext import fastmanifest
silenttestrunner.main(__name__)