##// END OF EJS Templates
exchange: support for streaming clone bundles...
exchange: support for streaming clone bundles Now that we have a mechanism to produce and consume streaming clone bundles, we need to teach the human-facing bundle specification parser and the internal bundle file header reading code to be aware of this new format. This patch does so. For the human-facing bundle specification, we choose the name "packed" to describe "streaming clone bundles" because the bundle is essentially a "pack" of raw revlog files that are "packed" together. There should probably be a bikeshed over the name, especially since it is human facing.

File last commit:

r19710:887ffa22 default
r26756:9e272a96 default
Show More
test-lrucachedict.py
38 lines | 871 B | text/x-python | PythonLexer
/ tests / test-lrucachedict.py
from mercurial import util
def printifpresent(d, xs):
for x in xs:
present = x in d
print "'%s' in d: %s" % (x, present)
if present:
print "d['%s']: %s" % (x, d[x])
def test_lrucachedict():
d = util.lrucachedict(4)
d['a'] = 'va'
d['b'] = 'vb'
d['c'] = 'vc'
d['d'] = 'vd'
# all of these should be present
printifpresent(d, ['a', 'b', 'c', 'd'])
# 'a' should be dropped because it was least recently used
d['e'] = 've'
printifpresent(d, ['a', 'b', 'c', 'd', 'e'])
# touch entries in some order (get or set).
d['e']
d['c'] = 'vc2'
d['d']
d['b'] = 'vb2'
# 'e' should be dropped now
d['f'] = 'vf'
printifpresent(d, ['b', 'c', 'd', 'e', 'f'])
d.clear()
printifpresent(d, ['b', 'c', 'd', 'e', 'f'])
if __name__ == '__main__':
test_lrucachedict()