D6123: Experimental features: Add condition to for float number (issue6099)

akshjain.jain74 (Akshit Jain) phabricator at mercurial-scm.org
Tue Mar 12 14:09:43 EDT 2019


akshjain.jain74 created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6123

AFFECTED FILES
  hgext/histedit.py
  mercurial/similar.py

CHANGE DETAILS

diff --git a/mercurial/similar.py b/mercurial/similar.py
--- a/mercurial/similar.py
+++ b/mercurial/similar.py
@@ -63,6 +63,7 @@
             equal += len(line)
 
     lengths = len(text) + len(orig)
+    if lengths > 0:
     return equal * 2.0 / lengths
 
 def score(fctx1, fctx2):
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1124,7 +1124,7 @@
     if next:
         index += 1
     else:
-        index += 1
+        index -= 1
     changeaction(state, pos, KEY_LIST[index % len(KEY_LIST)])
 
 def changeview(state, delta, unit):



To: akshjain.jain74, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list