# HG changeset patch # User Pierre-Yves David # Date 1409154548 -7200 # Node ID 0f31e3c44d82080354e85cadbecf1880df271334 # Parent 5459d9f48fea44ed9489e5528fe29d3cf3df80b4 evolve: use pushkeyescape from core It exists for all version we are compatible with. diff -r 5459d9f48fea -r 0f31e3c44d82 hgext/evolve.py --- a/hgext/evolve.py Wed Aug 27 17:55:20 2014 +0200 +++ b/hgext/evolve.py Wed Aug 27 17:49:08 2014 +0200 @@ -2337,29 +2337,6 @@ _pushkeyescape = getattr(obsolete, '_pushkeyescape', None) -if _pushkeyescape is None: - _maxpayload = 5300 - def _pushkeyescape(markers): - """encode markers into a dict suitable for pushkey exchange - - - binary data are base86 encoded - - splited in chunk less than 5300 bytes""" - parts = [] - currentlen = _maxpayload * 2 # ensure we create a new part - for marker in markers: - nextdata = obsolete._encodeonemarker(marker) - if (len(nextdata) + currentlen > _maxpayload): - currentpart = [] - currentlen = 0 - parts.append(currentpart) - currentpart.append(nextdata) - currentlen += len(nextdata) - keys = {} - for idx, part in enumerate(reversed(parts)): - data = ''.join([_pack('>B', 0)] + part) - keys['dump%i' % idx] = base85.b85encode(data) - return keys - def _encodemarkersstream(fp, markers): fp.write(_pack('>B', 0)) for mark in markers: