1
0
Fork 0
mirror of synced 2024-06-02 10:34:43 +12:00

show more info in merge conflict error message

This commit is contained in:
Nick Sweeting 2020-08-18 08:12:35 -04:00
parent 718d39e242
commit 77d2f08a5c

View file

@ -63,7 +63,7 @@ def merge_links(a: Link, b: Link) -> Link:
"""deterministially merge two links, favoring longer field values over shorter,
and "cleaner" values over worse ones.
"""
assert a.base_url == b.base_url, 'Cannot merge two links with different URLs'
assert a.base_url == b.base_url, f'Cannot merge two links with different URLs ({a.base_url} != {b.base_url})'
# longest url wins (because a fuzzy url will always be shorter)
url = a.url if len(a.url) > len(b.url) else b.url