Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/wireproto.py @ 36018:ae79cf6f9c82
wireproto: remove unnecessary exception trapping
The `try..except error.Abort` was added in 8474be4412ca 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.
Differential Revision: https://phab.mercurial-scm.org/D1996
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 31 Jan 2018 10:06:39 -0800 |
parents | d9e71cce3b2f |
children | b4976912a6ef |
comparison
equal
deleted
inserted
replaced
36017:59e4a7781a36 | 36018:ae79cf6f9c82 |
---|---|
912 | 912 |
913 if util.safehasattr(proto, 'restore'): | 913 if util.safehasattr(proto, 'restore'): |
914 | 914 |
915 proto.redirect() | 915 proto.redirect() |
916 | 916 |
917 try: | 917 r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key), |
918 r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key), | 918 encoding.tolocal(old), new) or False |
919 encoding.tolocal(old), new) or False | |
920 except error.Abort: | |
921 r = False | |
922 | 919 |
923 output = proto.restore() | 920 output = proto.restore() |
924 | 921 |
925 return '%s\n%s' % (int(r), output) | 922 return '%s\n%s' % (int(r), output) |
926 | 923 |