Mercurial > hg
comparison mercurial/dispatch.py @ 31958:de5c9d0e02ea
atexit: switch to home-grown implementation
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Tue, 11 Apr 2017 14:54:12 -0700 |
parents | c13ff31818b0 |
children | 71dcd4a4fa2f |
comparison
equal
deleted
inserted
replaced
31957:84f9eb9758c0 | 31958:de5c9d0e02ea |
---|---|
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from __future__ import absolute_import, print_function | 8 from __future__ import absolute_import, print_function |
9 | 9 |
10 import atexit | |
11 import difflib | 10 import difflib |
12 import errno | 11 import errno |
13 import getopt | 12 import getopt |
14 import os | 13 import os |
15 import pdb | 14 import pdb |
765 def print_time(): | 764 def print_time(): |
766 t = get_times() | 765 t = get_times() |
767 ui.warn( | 766 ui.warn( |
768 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") % | 767 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") % |
769 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) | 768 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) |
770 atexit.register(print_time) | 769 ui.atexit(print_time) |
771 | 770 |
772 if options['verbose'] or options['debug'] or options['quiet']: | 771 if options['verbose'] or options['debug'] or options['quiet']: |
773 for opt in ('verbose', 'debug', 'quiet'): | 772 for opt in ('verbose', 'debug', 'quiet'): |
774 val = str(bool(options[opt])) | 773 val = str(bool(options[opt])) |
775 if pycompat.ispy3: | 774 if pycompat.ispy3: |