sapling/eden/scm/edenscm/hgext/convert
Michael Devine 0dceab8e95 New custom immutable revision object to track commit conversions: conversionrevision
Summary:
The Mercurial convert extension passes around parameters to indicate a commit that needs to be converted from source to sink. For existing converters like Git, this is a simple 1:1 conversion: a commit in the source gets mapped to a commit in the sink, and so they use the source commit hash (sometimes called rev or version in the API) to represent the commit to be converted.

Our converter is much more complicated. Source commits get converted multiple times to account for different ways of mounting it into the destination file system and commit history. The commits are also coming from multiple source Git projects. This means that we need multiple pieces of data to represent a single commit conversion action.

Thus far, we've been trying to meet part of this need by using concatenated strings of (variant, commithash). This logic is breaking down as we add more fields. This commit adds a new immutable object called "conversionrevision" that represents the (variant, source commit hash, source project name, destination path) that is the unique identifier for the individual commit conversions we need to perform. This commit also includes logic for serializing and deserializing these objects as strings (useful because the converter seems to require commit IDs to be strings) and unit tests for all of the new logic.

Reviewed By: tchebb

Differential Revision: D19606867

fbshipit-source-id: 77815ca858f841d452874e95dfa3b351bafde306
2020-02-05 10:20:19 -08:00
..
__init__.py convert: delete support for gnuarchs, darcs, and bzr 2019-12-20 16:14:22 -08:00
common.py py3: iter{keys,values,items} -> pycompat.iter{keys,values,items} 2020-01-28 16:27:28 -08:00
convcmd.py unicode to pycompat.unicode 2020-01-28 15:45:17 -08:00
filemap.py py3: iter{keys,values,items} -> pycompat.iter{keys,values,items} 2020-01-28 16:27:28 -08:00
git.py convert: remove tags from convert 2019-12-20 16:14:19 -08:00
hg.py py3: iter{keys,values,items} -> pycompat.iter{keys,values,items} 2020-01-28 16:27:28 -08:00
p4.py convert: remove tags from convert 2019-12-20 16:14:19 -08:00
repo.py New custom immutable revision object to track commit conversions: conversionrevision 2020-02-05 10:20:19 -08:00
subversion.py pycompat: drop sysbytes, sysstr, strurl, bytesurl 2020-01-31 17:59:53 -08:00
transport.py unicode: consistently use 'utf-8' everywhere 2020-01-31 17:34:53 -08:00