Mercurial > hg
changeset 22330:e74f8a65252d
obsolete: move _fm0encodeonemarker next to _fm0readmarkers
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 25 Aug 2014 16:09:18 +0200 |
parents | ed37aa74d208 |
children | b130b241718e |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py Mon Aug 25 16:43:23 2014 +0200 +++ b/mercurial/obsolete.py Mon Aug 25 16:09:18 2014 +0200 @@ -200,6 +200,23 @@ yield (pre, sucs, flags, metadata, date, parents) +def _fm0encodeonemarker(marker): + pre, sucs, flags, metadata, date, parents = marker + metadata = decodemeta(metadata) + metadata['date'] = '%d %i' % date + if parents is not None: + if not parents: + # mark that we explicitly recorded no parents + metadata['p0'] = '' + for i, p in enumerate(parents): + metadata['p%i' % (i + 1)] = node.hex(p) + metadata = encodemeta(metadata) + nbsuc = len(sucs) + format = _fm0fixed + (_fm0node * nbsuc) + data = [nbsuc, len(metadata), flags, pre] + data.extend(sucs) + return _pack(format, *data) + metadata + def encodemeta(meta): """Return encoded metadata string to string mapping. @@ -430,23 +447,6 @@ yield _fm0encodeonemarker(marker) -def _fm0encodeonemarker(marker): - pre, sucs, flags, metadata, date, parents = marker - metadata = decodemeta(metadata) - metadata['date'] = '%d %i' % date - if parents is not None: - if not parents: - # mark that we explicitly recorded no parents - metadata['p0'] = '' - for i, p in enumerate(parents): - metadata['p%i' % (i + 1)] = node.hex(p) - metadata = encodemeta(metadata) - nbsuc = len(sucs) - format = _fm0fixed + (_fm0node * nbsuc) - data = [nbsuc, len(metadata), flags, pre] - data.extend(sucs) - return _pack(format, *data) + metadata - # arbitrary picked to fit into 8K limit from HTTP server # you have to take in account: # - the version header