Mercurial > hg-stable
changeset 22334:f2c3cfc30e9c
obsolete: move _encodemarkers next to _readmarkers
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 25 Aug 2014 16:21:33 +0200 |
parents | 5bf18f8ca89d |
children | 7c4c19dfd484 |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py Mon Aug 25 16:18:44 2014 +0200 +++ b/mercurial/obsolete.py Mon Aug 25 16:21:33 2014 +0200 @@ -147,8 +147,16 @@ % diskversion) return diskversion, formats[diskversion][0](data, off) +def _encodemarkers(markers, addheader=False, version=_fm0version): + # Kept separate from flushmarkers(), it will be reused for + # markers exchange. + encodeone = formats[version][1] + if addheader: + yield _pack('>B', _fm0version) + for marker in markers: + yield encodeone(marker) + def _fm0readmarkers(data, off=0): - """Read and enumerate markers from raw data in format version 0""" # Loop on markers l = len(data) while off + _fm0fsize <= l: @@ -444,15 +452,6 @@ seennodes |= pendingnodes return seenmarkers -def _encodemarkers(markers, addheader=False, version=_fm0version): - # Kept separate from flushmarkers(), it will be reused for - # markers exchange. - encodeone = formats[version][1] - if addheader: - yield _pack('>B', _fm0version) - for marker in markers: - yield encodeone(marker) - # arbitrary picked to fit into 8K limit from HTTP server # you have to take in account: