Skip to content
Snippets Groups Projects
user avatar
Georges Racinet authored
This follows the development patterns we've been using lately:
a single bunch of request attributes is given to, e.g, the
`assert_compare` method, which translates it to Git for Gitaly.
Request translation is fairly simple, taking care of direct
attributes that are declared to be commit SHAs.

Before comparison, the Mercurial response is also translated to
Git. This is done with a list of attribute dotted paths, with
the special convention that a name ending in `[]` represents a
list-like value on which iteration must happen (see example
in `tests_with_gitaly/test_commit.py`).

For cases where attributes are not comparable, or more generally
acknowledged to differ, the `normalizer` callable can be used.

It's not clear this makes tests easier to write, but it probably
makes them easier to read.

For the conversion of Mercurial SHAs to Git SHAs, we're
accessing the hg-git class, which is a bit heavy-handed but gives
us more chances to understand future incompatibility, as the
on-disk format storage of the mapping is due to change in hg-git.
d2a9a756
History
Name Last commit Last update