comparison mercurial/commands.py @ 4013:54fa628b8c78

catch socket.error fix issue394
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 29 Dec 2006 06:08:46 +0100
parents e282448d68f1
children 509342f95564
comparison
equal deleted inserted replaced
4012:d1e31d7f7d44 4013:54fa628b8c78
9 from node import * 9 from node import *
10 from i18n import gettext as _ 10 from i18n import gettext as _
11 demandload(globals(), "bisect os re sys signal imp urllib pdb shlex stat") 11 demandload(globals(), "bisect os re sys signal imp urllib pdb shlex stat")
12 demandload(globals(), "fancyopts ui hg util lock revlog bundlerepo") 12 demandload(globals(), "fancyopts ui hg util lock revlog bundlerepo")
13 demandload(globals(), "difflib patch time help mdiff tempfile") 13 demandload(globals(), "difflib patch time help mdiff tempfile")
14 demandload(globals(), "traceback errno version atexit") 14 demandload(globals(), "traceback errno version atexit socket")
15 demandload(globals(), "archival changegroup cmdutil hgweb.server sshserver") 15 demandload(globals(), "archival changegroup cmdutil hgweb.server sshserver")
16 16
17 class UnknownCommand(Exception): 17 class UnknownCommand(Exception):
18 """Exception raised if command is not in the command table.""" 18 """Exception raised if command is not in the command table."""
19 class AmbiguousCommand(Exception): 19 class AmbiguousCommand(Exception):
3271 if inst.errno == errno.EPIPE: 3271 if inst.errno == errno.EPIPE:
3272 if u.debugflag: 3272 if u.debugflag:
3273 u.warn(_("\nbroken pipe\n")) 3273 u.warn(_("\nbroken pipe\n"))
3274 else: 3274 else:
3275 raise 3275 raise
3276 except socket.error, inst:
3277 u.warn(_("abort: %s\n") % inst[1])
3276 except IOError, inst: 3278 except IOError, inst:
3277 if hasattr(inst, "code"): 3279 if hasattr(inst, "code"):
3278 u.warn(_("abort: %s\n") % inst) 3280 u.warn(_("abort: %s\n") % inst)
3279 elif hasattr(inst, "reason"): 3281 elif hasattr(inst, "reason"):
3280 try: # usually it is in the form (errno, strerror) 3282 try: # usually it is in the form (errno, strerror)