diff hgext/inhibit.py @ 1474:8e6de39b724d

inhibit: don't abort when directaccess is not enabled When directaccess is not enabled, we should just print a warning and not set up inhibit. We don't need to abort in that case. Example: if the user is running hg showconfig, we don't want to crash as the command is unrelated to inhibit.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 29 Jul 2015 09:55:50 -0700
parents a8a4c8b8550d
children 3dec62fc266e
line wrap: on
line diff
--- a/hgext/inhibit.py	Fri Jul 10 22:58:13 2015 +0100
+++ b/hgext/inhibit.py	Wed Jul 29 09:55:50 2015 -0700
@@ -196,8 +196,11 @@
     try:
         extensions.find('directaccess')
     except KeyError:
-        errormsg = _('Cannot use inhibit without the direct access extension')
-        raise error.Abort(errormsg)
+        errormsg = _('cannot use inhibit without the direct access extension\n')
+        hint = _("(please enable it or inhibit won\'t work)\n")
+        ui.warn(errormsg)
+        ui.warn(hint)
+        return
 
     # Wrapping this to inhibit obsolete revs resulting from a transaction
     extensions.wrapfunction(localrepo.localrepository,