DiffService.GetPatchId: initial implementation
Since `git patch-id` does not involve the repository at all (it ingests a patch and outputs a hash), we are actually spawning it, with a Mercurial generated patch. For general consistency (and hoping it does not matter so much), we are computing the index lines as for the `RawDiff` method, but Git seems to actually ignore it. We are avoiding to extract the full content of binary files, as it would be expensive and essentially useless. This is also what Gitaly does, and we probably should generalize it to some other `DiffService` methods (to be checked) As the Comparison Tests display, the patch id computed by HGitaly turns out to be identical to the done by Gitaly for simple text-only diffs. That will obviously not be true of binary diffs.
Showing
- hgext3rd/hgitaly/__init__.py 1 addition, 0 deletionshgext3rd/hgitaly/__init__.py
- hgitaly/diff.py 104 additions, 1 deletionhgitaly/diff.py
- hgitaly/service/diff.py 26 additions, 2 deletionshgitaly/service/diff.py
- hgitaly/service/tests/test_diff.py 67 additions, 0 deletionshgitaly/service/tests/test_diff.py
- hgitaly/tests/test_diff.py 98 additions, 0 deletionshgitaly/tests/test_diff.py
- tests_with_gitaly/test_diff.py 33 additions, 0 deletionstests_with_gitaly/test_diff.py
Loading
Please register or sign in to comment