Refactor pack index writing to a common API
To repack a repository or to push a pack file over a dumb transport
we need to create a .idx file to match the .pack. This means
the index writing features of transport.IndexPack are needed by
PackWriter, and/or dumb protocol transports.
This refactoring creates a PackIndexWriter class structure that
mirrors the PackIndex (reader) structure we already have in place
for PackIndexV1 and PackIndexV2.
At present only PackIndexV1 is supported as we do not have access
to the CRC data necessary to write PackIndexV2 style files.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>