##// END OF EJS Templates
bundle2: make server.bundle2.stream default to True...
bundle2: make server.bundle2.stream default to True Support for bundle2 streaming clones has been shipped in Mercurial 4.5 (7eedbd5d4880), but was never activated by default. It's time to have more people use it. The new format allows streaming clones to transport cache (hooray for speed) and phaseroots (fixes phase-related issues). Changes in tests: bundle2 capabilities now have "stream=v2" (plus a '\n' as a separator) and therefore take 14 bytes more: "%0Astream%3Dv2". Tip for tests that have data encoded with CBOR: 0xd3 - 0xc5 = 14. $USUAL_BUNDLE2_CAPS$ replaces $USUAL_BUNDLE2_CAPS_SERVER$, which is the same thing, but without "stream=v2". Since streaming clones now also transfer caches, the reported byte and file counts are higher (e.g. 816 bytes in 9 files instead of 613 bytes in 4 files, a bit of --debug and manual math confirms that the caches take these extra 203 bytes in 5 files). Differential Revision: https://phab.mercurial-scm.org/D4680

File last commit:

r37828:856f381a stable
r39758:4bd6e444 default
Show More
interfaceutil.py
40 lines | 1.1 KiB | text/x-python | PythonLexer
# interfaceutil.py - Utilities for declaring interfaces.
#
# Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# zope.interface imposes a run-time cost due to module import overhead and
# bookkeeping for declaring interfaces. So, we use stubs for various
# zope.interface primitives unless instructed otherwise.
from __future__ import absolute_import
from .. import (
encoding,
)
if encoding.environ.get('HGREALINTERFACES'):
from ..thirdparty.zope import (
interface as zi,
)
Attribute = zi.Attribute
Interface = zi.Interface
implementer = zi.implementer
else:
class Attribute(object):
def __init__(self, __name__, __doc__=''):
pass
class Interface(object):
def __init__(self, name, bases=(), attrs=None, __doc__=None,
__module__=None):
pass
def implementer(*ifaces):
def wrapper(cls):
return cls
return wrapper