renames: call hgutil.Abort from the correct module

Before this change, setting git.similarity to a value out of range would
result in a traceback because 'util' is hg-git's own module. Adds a test
demonstrating the fixed behavior.
This commit is contained in:
Kevin Bullock 2017-10-24 15:10:15 -05:00
parent 0d77da5d21
commit f91d77ed8a
2 changed files with 7 additions and 1 deletions

View File

@ -1547,7 +1547,7 @@ class GitHandler(object):
# disabled by default to avoid surprises
similarity = self.ui.configint('git', 'similarity', default=0)
if similarity < 0 or similarity > 100:
raise util.Abort(_('git.similarity must be between 0 and 100'))
raise hgutil.Abort(_('git.similarity must be between 0 and 100'))
if similarity == 0:
return None

View File

@ -600,3 +600,9 @@ findcopiesharder finds copies from unmodified files if similarity is met
+4
+5
+6
Config values out of range
$ hg --config git.similarity=999 clone gitcopyharder hgcopyharder2
importing git objects into hg
abort: git.similarity must be between 0 and 100
[255]