mercurial/localrepo.py
changeset 23426 19ebd2f88fc7
parent 23379 86c6f06feb04
parent 23416 53a65929ef1f
child 23510 065c0334846f
--- a/mercurial/localrepo.py	Fri Nov 28 20:16:15 2014 +0100
+++ b/mercurial/localrepo.py	Mon Dec 01 19:34:11 2014 -0600
@@ -1767,8 +1767,14 @@
         return ret
 
     def pushkey(self, namespace, key, old, new):
-        self.hook('prepushkey', throw=True, namespace=namespace, key=key,
-                  old=old, new=new)
+        try:
+            self.hook('prepushkey', throw=True, namespace=namespace, key=key,
+                      old=old, new=new)
+        except error.HookAbort, exc:
+            self.ui.write_err(_("pushkey-abort: %s\n") % exc)
+            if exc.hint:
+                self.ui.write_err(_("(%s)\n") % exc.hint)
+            return False
         self.ui.debug('pushing key for "%s:%s"\n' % (namespace, key))
         ret = pushkey.push(self, namespace, key, old, new)
         self.hook('pushkey', namespace=namespace, key=key, old=old, new=new,