changeset 1060:0a4b119fb2b4

renames: fix range check for renamelimit
author Kevin Bullock <kbullock@ringworld.org>
date Tue, 24 Oct 2017 15:21:55 -0500
parents d4dfa3c79d78
children b236d7259c2d
files hggit/git_handler.py tests/test-renames.t
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -1553,8 +1553,8 @@
 
         # default is borrowed from Git
         max_files = self.ui.configint('git', 'renamelimit', default=400)
-        if similarity < 0:
-            raise util.Abort(_('git.renamelimit must be non-negative'))
+        if max_files < 0:
+            raise hgutil.Abort(_('git.renamelimit must be non-negative'))
         if max_files == 0:
             max_files = None
 
--- a/tests/test-renames.t
+++ b/tests/test-renames.t
@@ -606,8 +606,7 @@
   importing git objects into hg
   abort: git.similarity must be between 0 and 100
   [255]
-This clone should not succeed [BUG]
   $ hg --config git.renamelimit=-5 clone gitcopyharder hgcopyharder2
   importing git objects into hg
-  updating to branch default
-  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  abort: git.renamelimit must be non-negative
+  [255]