I came across some confusing errors when combining patch_socket, patch_ssl of Gevent 0.13.0 (the one in Ubuntu 11.10) and Mercurial today. If you get this error:

__init__() got an unexpected keyword argument 'ciphers'

update your Gevent version to at least 0.13.1. That should resolve your issue. Good luck!