Patchwork D1996: wireproto: remove unnecessary exception trapping

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 11:37 p.m.
Message ID <differential-rev-PHID-DREV-h2kopkaoqkjr4c6q543a-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27203/
State Superseded
Headers show

Comments

phabricator - Feb. 1, 2018, 11:37 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The `try..except error.Abort` was added in https://phab.mercurial-scm.org/rHG8474be4412ca5eb4e67047a97acb7cb7f3120ff0 back in
  
  2012. The intent was to ensure a failing pushkey hook didn't crash
  
  the server.
  
  Since that changeset, repo.pushkey() and the hooks mechanism is
  now much more robust about trapping errors itself. As such, we no
  longer need this try..except block. So it has been removed.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1996

AFFECTED FILES
  mercurial/wireproto.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -914,11 +914,8 @@ 
 
         proto.redirect()
 
-        try:
-            r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key),
-                             encoding.tolocal(old), new) or False
-        except error.Abort:
-            r = False
+        r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key),
+                         encoding.tolocal(old), new) or False
 
         output = proto.restore()