Submitter | phabricator |
---|---|
Date | Oct. 15, 2017, 3:14 p.m. |
Message ID | <differential-rev-PHID-DREV-prrwkrsxoolp7kvjs235-req@phab.mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/24953/ |
State | Superseded |
Headers | show |
Comments
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > releasenotes.py:222 > + try: > + import fuzzywuzzy.fuzz as fuzz > + except ImportError: Needs to evaluate the fuzz module to get around the demandimport. e.g. try: from fuzzywuzzy import fuzz fuzz.token_set_ratio except ImportError > releasenotes.py:224 > + except ImportError: > + return False > merge = True Perhaps it should return True. Any maybe it should show warning, status or debug message? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1096 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel
pulkit added inline comments. INLINE COMMENTS > yuja wrote in releasenotes.py:224 > Perhaps it should return True. > > Any maybe it should show warning, status or debug message? Yes it should return True and I think the doc of this function is wrong. Nice catch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1096 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel
pulkit added inline comments. INLINE COMMENTS > yuja wrote in releasenotes.py:224 > Perhaps it should return True. > > Any maybe it should show warning, status or debug message? Also, whatever message we will use here, warning, status or debug, it will be repeated a lot of times as the function is called a lot of times. This extension need some cleanup. :( REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1096 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel
Patch
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)