From f91d77ed8a100b7ba592c565804b79c73528b72e Mon Sep 17 00:00:00 2001 From: Kevin Bullock Date: Tue, 24 Oct 2017 15:10:15 -0500 Subject: [PATCH] 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. --- hggit/git_handler.py | 2 +- tests/test-renames.t | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hggit/git_handler.py b/hggit/git_handler.py index af5880ff99..16e254594b 100644 --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -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 diff --git a/tests/test-renames.t b/tests/test-renames.t index 1114e80455..a33163a418 100644 --- a/tests/test-renames.t +++ b/tests/test-renames.t @@ -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]