Mercurial > evolve
diff hgext/simple4server.py @ 1091:236a8e81551e
compat: use in-core encodemarkers
Now exist in core witha slightly different format.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 27 Aug 2014 18:16:10 +0200 |
parents | 4a6479395a9d |
children | 580a2d838996 |
line wrap: on
line diff
--- a/hgext/simple4server.py Wed Aug 27 18:15:39 2014 +0200 +++ b/hgext/simple4server.py Wed Aug 27 18:16:10 2014 +0200 @@ -75,15 +75,6 @@ repo.hook('evolve_pushobsmarkers') return wireproto.pushres(0) -# from mercurial.obsolete: 19e9478c1a22 -def _encodemarkersstream(fp, markers): - """write a binary version of a set of markers - - Includes the initial version number""" - fp.write(_pack('>B', 0)) - for mark in markers: - fp.write(obsolete._encodeonemarker(mark)) - # from evolve extension: 1a23c7c52a43 def _getobsmarkersstream(repo, heads=None, common=None): """Get a binary stream for all markers relevant to `::<heads> - ::<common>` @@ -104,7 +95,8 @@ nodes = [c.node() for c in repo.set(revset, *args)] markers = repo.obsstore.relevantmarkers(nodes) obsdata = StringIO() - _encodemarkersstream(obsdata, markers) + for chunk in obsolete.encodemarkers(markers, True): + obsdata.write(chunk) obsdata.seek(0) return obsdata