# HG changeset patch
# User Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
# Date 1527293147 -7200
#      Sat May 26 02:05:47 2018 +0200
# Node ID 0b5287519bcafc0d9bb00536f923f32debe4c89d
# Parent  fc144a88e9049ac6e5f9d359ccbe834c2ed53901
Abort problems on 4.6

diff --git a/HISTORY.txt b/HISTORY.txt
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -1,7 +1,7 @@
-1.3.4
+1.3.5
 ~~~~~~~~~~~~~
 
-Tested with hg 4.5 and 4.6
+Tested with hg 4.5 and 4.6, small 4.6-related fixes (error handling)
 
 1.3.3
 ~~~~~~~~~~~~~
diff --git a/mercurial_path_pattern.py b/mercurial_path_pattern.py
--- a/mercurial_path_pattern.py
+++ b/mercurial_path_pattern.py
@@ -68,7 +68,7 @@
 http://bitbucket.org/Mekk/mercurial-path_pattern/
 """
 
-from mercurial import commands, util
+from mercurial import commands, util, error
 from mercurial.i18n import _
 import os
 import sys
@@ -93,7 +93,7 @@
         try:
             import mercurial_extension_utils
         except ImportError:
-            raise util.Abort(_("""Can not import mercurial_extension_utils.
+            raise error.Abort(_("""Can not import mercurial_extension_utils.
 Please install this module in Python path.
 See Installation chapter in https://bitbucket.org/Mekk/mercurial-dynamic_username/ for details
 (and for info about TortoiseHG on Windows, or other bundled Python)."""))
@@ -347,10 +347,10 @@
             known_paths.append(key)
     # Failing helpfully
     if known_paths:
-        raise util.Abort(_("Unknown alias: %s. Defined path aliases: %s") % (
+        raise error.Abort(_("Unknown alias: %s. Defined path aliases: %s") % (
             path_alias, ", ".join(known_paths)))
     else:
-        raise util.Abort(_("Uknown alias: %s. No paths defined, consider creating some paths or path_patterns") % path_alias)
+        raise error.Abort(_("Uknown alias: %s. No paths defined, consider creating some paths or path_patterns") % path_alias)
 
 ############################################################
 # Extension setup
diff --git a/tests/basic.t b/tests/basic.t
--- a/tests/basic.t
+++ b/tests/basic.t
@@ -171,3 +171,8 @@
       local:  /tmp/cramtests-*/basic.t/work/tree1/{repo} (glob)
       remote: /tmp/cramtests-*/basic.t/work/sub/tree2/{repo} (glob)
 
+Error reactions
+
+  $ hg --cwd $T1/bbb/sub_b/repo_b3 cloneto niematakiegorepo
+  abort: Unknown alias: niematakiegorepo. Defined path aliases: flat, symm
+  [255]
\ No newline at end of file