Mercurial > hg
comparison mercurial/repair.py @ 30975:22fbca1d11ed
mercurial: switch to util.timer for all interval timings
util.timer is now the best available interval timer, at the expense of not
having a known epoch. Let's use it whenever the epoch is irrelevant.
author | Simon Farnsworth <simonfar@fb.com> |
---|---|
date | Wed, 15 Feb 2017 13:17:39 -0800 |
parents | f2c069bf78ee |
children | 254f98326eef |
comparison
equal
deleted
inserted
replaced
30974:ae5d60bb70c9 | 30975:22fbca1d11ed |
---|---|
10 | 10 |
11 import errno | 11 import errno |
12 import hashlib | 12 import hashlib |
13 import stat | 13 import stat |
14 import tempfile | 14 import tempfile |
15 import time | |
16 | 15 |
17 from .i18n import _ | 16 from .i18n import _ |
18 from .node import short | 17 from .node import short |
19 from . import ( | 18 from . import ( |
20 bundle2, | 19 bundle2, |
903 | 902 |
904 # Now swap in the new store directory. Doing it as a rename should make | 903 # Now swap in the new store directory. Doing it as a rename should make |
905 # the operation nearly instantaneous and atomic (at least in well-behaved | 904 # the operation nearly instantaneous and atomic (at least in well-behaved |
906 # environments). | 905 # environments). |
907 ui.write(_('replacing store...\n')) | 906 ui.write(_('replacing store...\n')) |
908 tstart = time.time() | 907 tstart = util.timer() |
909 util.rename(srcrepo.spath, backupvfs.join('store')) | 908 util.rename(srcrepo.spath, backupvfs.join('store')) |
910 util.rename(dstrepo.spath, srcrepo.spath) | 909 util.rename(dstrepo.spath, srcrepo.spath) |
911 elapsed = time.time() - tstart | 910 elapsed = util.timer() - tstart |
912 ui.write(_('store replacement complete; repository was inconsistent for ' | 911 ui.write(_('store replacement complete; repository was inconsistent for ' |
913 '%0.1fs\n') % elapsed) | 912 '%0.1fs\n') % elapsed) |
914 | 913 |
915 # We first write the requirements file. Any new requirements will lock | 914 # We first write the requirements file. Any new requirements will lock |
916 # out legacy clients. | 915 # out legacy clients. |