# HG changeset patch # User Pierre-Yves David # Date 2021-05-20 19:48:53 # Node ID f286d715f9abc70cef726fd850e14ef4ed345d5d # Parent 0a3fa41fa719ea3469c316b8d8b3d779ab8b10fe revlogv2: simplify and clarify the processing of each entry As we add more entries and some of them has non trivial processing it seems useful to make the processing leaner and clearly separated to simplify futures patches. Differential Revision: https://phab.mercurial-scm.org/D10773 diff --git a/mercurial/revlogutils/docket.py b/mercurial/revlogutils/docket.py --- a/mercurial/revlogutils/docket.py +++ b/mercurial/revlogutils/docket.py @@ -238,18 +238,29 @@ def parse_docket(revlog, data, use_pendi """given some docket data return a docket object for the given revlog""" header = S_HEADER.unpack(data[: S_HEADER.size]) offset = S_HEADER.size - version_header = header[0] - index_uuid_size = header[1] + + iheader = iter(header) + + version_header = next(iheader) + + index_uuid_size = next(iheader) index_uuid = data[offset : offset + index_uuid_size] offset += index_uuid_size - data_uuid_size = header[2] + + data_uuid_size = next(iheader) data_uuid = data[offset : offset + data_uuid_size] offset += data_uuid_size - index_size = header[3] - pending_index_size = header[4] - data_size = header[5] - pending_data_size = header[6] - default_compression_header = header[7] + + index_size = next(iheader) + + pending_index_size = next(iheader) + + data_size = next(iheader) + + pending_data_size = next(iheader) + + default_compression_header = next(iheader) + docket = RevlogDocket( revlog, use_pending=use_pending,