##// END OF EJS Templates
revlog: skeleton support for version 2 revlogs...
revlog: skeleton support for version 2 revlogs There are a number of improvements we want to make to revlogs that will require a new version - version 2. It is unclear what the full set of improvements will be or when we'll be done with them. What I do know is that the process will likely take longer than a single release, will require input from various stakeholders to evaluate changes, and will have many contentious debates and bikeshedding. It is unrealistic to develop revlog version 2 up front: there are just too many uncertainties that we won't know until things are implemented and experiments are run. Some changes will also be invasive and prone to bit rot, so sitting on dozens of patches is not practical. This commit introduces skeleton support for version 2 revlogs in a way that is flexible and not bound by backwards compatibility concerns. An experimental repo requirement for denoting revlog v2 has been added. The requirement string has a sub-version component to it. This will allow us to declare multiple requirements in the course of developing revlog v2. Whenever we change the in-development revlog v2 format, we can tweak the string, creating a new requirement and locking out old clients. This will allow us to make as many backwards incompatible changes and experiments to revlog v2 as we want. In other words, we can land code and make meaningful progress towards revlog v2 while still maintaining extreme format flexibility up until the point we freeze the format and remove the experimental labels. To enable the new repo requirement, you must supply an experimental and undocumented config option. But not just any boolean flag will do: you need to explicitly use a value that no sane person should ever type. This is an additional guard against enabling revlog v2 on an installation it shouldn't be enabled on. The specific scenario I'm trying to prevent is say a user with a 4.4 client with a frozen format enabling the option but then downgrading to 4.3 and accidentally creating repos with an outdated and unsupported repo format. Requiring a "challenge" string should prevent this. Because the format is not yet finalized and I don't want to take any chances, revlog v2's version is currently 0xDEAD. I figure squatting on a value we're likely never to use as an actual revlog version to mean "internal testing only" is acceptable. And "dead" is easily recognized as something meaningful. There is a bunch of cleanup that is needed before work on revlog v2 begins in earnest. I plan on doing that work once this patch is accepted and we're comfortable with the idea of starting down this path.

File last commit:

r31796:e0dc4053 default
r32697:19b9fc40 default
Show More
setup.py
76 lines | 2.1 KiB | text/x-python | PythonLexer
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 #!/usr/bin/env python
# Copyright (c) 2016-present, Gregory Szorc
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 import sys
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 from setuptools import setup
try:
import cffi
except ImportError:
cffi = None
import setup_zstd
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 SUPPORT_LEGACY = False
if "--legacy" in sys.argv:
SUPPORT_LEGACY = True
sys.argv.remove("--legacy")
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 # Code for obtaining the Extension instance is in its own module to
# facilitate reuse in other projects.
Gregory Szorc
zstd: vendor python-zstandard 0.6.0...
r30822 extensions = [setup_zstd.get_c_extension(SUPPORT_LEGACY, 'zstd')]
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 install_requires = []
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 if cffi:
import make_cffi
extensions.append(make_cffi.ffi.distutils_extension())
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 # Need change in 1.8 for ffi.from_buffer() behavior.
install_requires.append('cffi>=1.8')
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 version = None
with open('c-ext/python-zstandard.h', 'r') as fh:
for line in fh:
if not line.startswith('#define PYTHON_ZSTANDARD_VERSION'):
continue
version = line.split()[2][1:-1]
break
if not version:
raise Exception('could not resolve package version; '
'this should never happen')
setup(
name='zstandard',
version=version,
description='Zstandard bindings for Python',
long_description=open('README.rst', 'r').read(),
url='https://github.com/indygreg/python-zstandard',
author='Gregory Szorc',
author_email='gregory.szorc@gmail.com',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: C',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 'Programming Language :: Python :: 3.6',
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 ],
keywords='zstandard zstd compression',
ext_modules=extensions,
test_suite='tests',
Gregory Szorc
zstd: vendor python-zstandard 0.8.0...
r31796 install_requires=install_requires,
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 )