Mercurial > hg-git
changeset 1057:20b6df4e9434
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.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Tue, 24 Oct 2017 15:10:15 -0500 |
parents | 312c4bb96e68 |
children | d4dfa3c79d78 |
files | hggit/git_handler.py tests/test-renames.t |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/git_handler.py Mon Oct 23 14:41:36 2017 -0500 +++ b/hggit/git_handler.py Tue Oct 24 15:10:15 2017 -0500 @@ -1547,7 +1547,7 @@ # 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
--- a/tests/test-renames.t Mon Oct 23 14:41:36 2017 -0500 +++ b/tests/test-renames.t Tue Oct 24 15:10:15 2017 -0500 @@ -600,3 +600,9 @@ +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]