Mercurial > hg
changeset 34810:44bd29168d14
releasenotes: make the import of fuzzywuzzy optional
If fuzzywuzzy is note present, we will not be having the capability to merge
existing releasenotes with the new releasenotes on the similarity basis.
The merging will still work good for exact same releasenotes entries.
Differential Revision: https://phab.mercurial-scm.org/D1096
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 15 Oct 2017 20:29:16 +0530 |
parents | 3a65012be661 |
children | a542ad320adb |
files | hgext/releasenotes.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/releasenotes.py Mon Oct 16 22:51:58 2017 -0400 +++ b/hgext/releasenotes.py Sun Oct 15 20:29:16 2017 +0530 @@ -218,7 +218,12 @@ """ Returns false when note fragment can be merged to existing notes. """ - import fuzzywuzzy.fuzz as fuzz + try: + import fuzzywuzzy.fuzz as fuzz + fuzz.token_set_ratio + except ImportError: + return True + merge = True for bullet in existingnotes: score = fuzz.token_set_ratio(incoming_str, bullet)