D1096: releasenotes: make the import of fuzzywuzzy optional
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Sun Oct 15 15:14:59 UTC 2017
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1096
AFFECTED FILES
hgext/releasenotes.py
CHANGE DETAILS
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -218,7 +218,10 @@
"""
Returns true when note fragment can be merged to existing notes.
"""
- import fuzzywuzzy.fuzz as fuzz
+ try:
+ import fuzzywuzzy.fuzz as fuzz
+ except ImportError:
+ return False
merge = True
for bullet in existingnotes:
score = fuzz.token_set_ratio(incoming_str, bullet)
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list