mercurial/localrepo.py
branchstable
changeset 23416 53a65929ef1f
parent 23129 eb315418224c
child 23426 19ebd2f88fc7
--- a/mercurial/localrepo.py	Sat Nov 29 19:13:35 2014 -0800
+++ b/mercurial/localrepo.py	Sat Nov 29 19:17:47 2014 -0800
@@ -1754,8 +1754,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,