Skip to content
Snippets Groups Projects
Commit ebfcb066 authored by Sangeet Kumar Mishra's avatar Sangeet Kumar Mishra
Browse files

test: change test's diff generation to use mdiff for nicer output

The current diff being used by tests upon failing is not very good. Sometimes it gives a lot of redundancy.
To see for yourself, follow these steps:

Download this bundle : http://bit.ly/2DuJjsS
$ hg clone https://www.mercurial-scm.org/hg
$ cd hg/
$ hg unbundle a1e70c1dbec0.hg
$ hg up a1e70c1dbec0^
$ hg revert --all --rev a1e70c1dbec0
$ hg revert -i tests/test-bookmarks-pushpull.t # revert only the last three hunks (press 'n' for the first 8, and 'y' for the last three)
$ cd tests
$ hg diff --rev a1e70c1dbec0 # nice output from Mercurial
$ ./run-test.py test-bookmarks-pushpull.t # poor output from the test runner
If you couldn’t follow those steps, you can simply check the diffs here:

* test's diff: https://pastebin.com/Z4LRg4vx
* diff used by hg diff: https://pastebin.com/qanQEsiA

Tests uses _unified_diff based on difflib.py. The output isn't great!

Mercurial's diff uses mdiff which gives better diffs. This patch uses mdiff's unidiff function to generate the diff for the failed tests.
parent 6408777c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment