Show More
@@ -26,7 +26,7 b' def dispatch(args):' | |||||
26 |
|
26 | |||
27 | def _runcatch(ui, args): |
|
27 | def _runcatch(ui, args): | |
28 | def catchterm(*args): |
|
28 | def catchterm(*args): | |
29 |
raise |
|
29 | raise error.SignalInterrupt | |
30 |
|
30 | |||
31 | for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM': |
|
31 | for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM': | |
32 | num = getattr(signal, name, None) |
|
32 | num = getattr(signal, name, None) | |
@@ -74,7 +74,7 b' def _runcatch(ui, args):' | |||||
74 | (inst.desc or inst.filename, inst.strerror)) |
|
74 | (inst.desc or inst.filename, inst.strerror)) | |
75 | except error.RevlogError, inst: |
|
75 | except error.RevlogError, inst: | |
76 | ui.warn(_("abort: %s!\n") % inst) |
|
76 | ui.warn(_("abort: %s!\n") % inst) | |
77 |
except |
|
77 | except error.SignalInterrupt: | |
78 | ui.warn(_("killed!\n")) |
|
78 | ui.warn(_("killed!\n")) | |
79 | except KeyboardInterrupt: |
|
79 | except KeyboardInterrupt: | |
80 | try: |
|
80 | try: |
@@ -56,3 +56,6 b' class UnknownCommand(Exception):' | |||||
56 | class AmbiguousCommand(Exception): |
|
56 | class AmbiguousCommand(Exception): | |
57 | """Exception raised if command shortcut matches more than one command.""" |
|
57 | """Exception raised if command shortcut matches more than one command.""" | |
58 |
|
58 | |||
|
59 | # derived from KeyboardInterrupt to simplify some breakout code | |||
|
60 | class SignalInterrupt(KeyboardInterrupt): | |||
|
61 | """Exception raised on SIGTERM and SIGHUP.""" |
@@ -75,7 +75,7 b' def loadall(ui):' | |||||
75 | path = os.path.expanduser(path) |
|
75 | path = os.path.expanduser(path) | |
76 | try: |
|
76 | try: | |
77 | load(ui, name, path) |
|
77 | load(ui, name, path) | |
78 |
except |
|
78 | except KeyboardInterrupt: | |
79 | raise |
|
79 | raise | |
80 | except Exception, inst: |
|
80 | except Exception, inst: | |
81 | if path: |
|
81 | if path: |
@@ -49,7 +49,7 b' def _pythonhook(ui, repo, name, hname, f' | |||||
49 | (hname, funcname)) |
|
49 | (hname, funcname)) | |
50 | try: |
|
50 | try: | |
51 | r = obj(ui=ui, repo=repo, hooktype=name, **args) |
|
51 | r = obj(ui=ui, repo=repo, hooktype=name, **args) | |
52 |
except |
|
52 | except KeyboardInterrupt: | |
53 | raise |
|
53 | raise | |
54 | except Exception, exc: |
|
54 | except Exception, exc: | |
55 | if isinstance(exc, util.Abort): |
|
55 | if isinstance(exc, util.Abort): |
@@ -412,7 +412,7 b' class localrepository(repo.repository):' | |||||
412 | if not l: continue |
|
412 | if not l: continue | |
413 | node, label = l.split(" ", 1) |
|
413 | node, label = l.split(" ", 1) | |
414 | partial[label.strip()] = bin(node) |
|
414 | partial[label.strip()] = bin(node) | |
415 |
except |
|
415 | except KeyboardInterrupt: | |
416 | raise |
|
416 | raise | |
417 | except Exception, inst: |
|
417 | except Exception, inst: | |
418 | if self.ui.debugflag: |
|
418 | if self.ui.debugflag: |
@@ -185,9 +185,6 b' extendeddateformats = defaultdateformats' | |||||
185 | "%b %Y", |
|
185 | "%b %Y", | |
186 | ) |
|
186 | ) | |
187 |
|
187 | |||
188 | class SignalInterrupt(Exception): |
|
|||
189 | """Exception raised on SIGTERM and SIGHUP.""" |
|
|||
190 |
|
||||
191 | # differences from SafeConfigParser: |
|
188 | # differences from SafeConfigParser: | |
192 | # - case-sensitive keys |
|
189 | # - case-sensitive keys | |
193 | # - allows values that are not strings (this means that you may not |
|
190 | # - allows values that are not strings (this means that you may not |
General Comments 0
You need to be logged in to leave comments.
Login now