Mercurial > hg
comparison contrib/perf.py @ 51700:7f0cb9ee0534
Backout accidental publication of a large range of revisions
I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 23 Jul 2024 10:02:46 +0200 |
parents | 493034cc3265 |
children | ca7bde5dbafb |
comparison
equal
deleted
inserted
replaced
51699:bd1483fd7088 | 51700:7f0cb9ee0534 |
---|---|
128 perf_rl_kind = (revlog_constants.KIND_OTHER, b'created-by-perf') | 128 perf_rl_kind = (revlog_constants.KIND_OTHER, b'created-by-perf') |
129 | 129 |
130 def revlog(opener, *args, **kwargs): | 130 def revlog(opener, *args, **kwargs): |
131 return mercurial.revlog.revlog(opener, perf_rl_kind, *args, **kwargs) | 131 return mercurial.revlog.revlog(opener, perf_rl_kind, *args, **kwargs) |
132 | 132 |
133 | |
133 except (ImportError, AttributeError): | 134 except (ImportError, AttributeError): |
134 perf_rl_kind = None | 135 perf_rl_kind = None |
135 | 136 |
136 def revlog(opener, *args, **kwargs): | 137 def revlog(opener, *args, **kwargs): |
137 return mercurial.revlog.revlog(opener, *args, **kwargs) | 138 return mercurial.revlog.revlog(opener, *args, **kwargs) |
257 | 258 |
258 def command(name, options=(), synopsis=None, norepo=False): | 259 def command(name, options=(), synopsis=None, norepo=False): |
259 if norepo: | 260 if norepo: |
260 commands.norepo += b' %s' % b' '.join(parsealiases(name)) | 261 commands.norepo += b' %s' % b' '.join(parsealiases(name)) |
261 return _command(name, list(options), synopsis) | 262 return _command(name, list(options), synopsis) |
263 | |
262 | 264 |
263 else: | 265 else: |
264 # for "historical portability": | 266 # for "historical portability": |
265 # define "@command" annotation locally, because cmdutil.command | 267 # define "@command" annotation locally, because cmdutil.command |
266 # has been available since 1.9 (or 2daa5179e73f) | 268 # has been available since 1.9 (or 2daa5179e73f) |
1922 deeper lookup benchmarking, checkout the `perfnodemap` command.""" | 1924 deeper lookup benchmarking, checkout the `perfnodemap` command.""" |
1923 import mercurial.revlog | 1925 import mercurial.revlog |
1924 | 1926 |
1925 opts = _byteskwargs(opts) | 1927 opts = _byteskwargs(opts) |
1926 timer, fm = gettimer(ui, opts) | 1928 timer, fm = gettimer(ui, opts) |
1927 mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg | 1929 mercurial.revlog._prereadsize = 2 ** 24 # disable lazy parser in old hg |
1928 if opts[b'no_lookup']: | 1930 if opts[b'no_lookup']: |
1929 if opts['rev']: | 1931 if opts['rev']: |
1930 raise error.Abort('--no-lookup and --rev are mutually exclusive') | 1932 raise error.Abort('--no-lookup and --rev are mutually exclusive') |
1931 nodes = [] | 1933 nodes = [] |
1932 elif not opts[b'rev']: | 1934 elif not opts[b'rev']: |
1981 """ | 1983 """ |
1982 import mercurial.revlog | 1984 import mercurial.revlog |
1983 | 1985 |
1984 opts = _byteskwargs(opts) | 1986 opts = _byteskwargs(opts) |
1985 timer, fm = gettimer(ui, opts) | 1987 timer, fm = gettimer(ui, opts) |
1986 mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg | 1988 mercurial.revlog._prereadsize = 2 ** 24 # disable lazy parser in old hg |
1987 | 1989 |
1988 unfi = repo.unfiltered() | 1990 unfi = repo.unfiltered() |
1989 clearcaches = opts[b'clear_caches'] | 1991 clearcaches = opts[b'clear_caches'] |
1990 # find the filecache func directly | 1992 # find the filecache func directly |
1991 # This avoid polluting the benchmark with the filecache logic | 1993 # This avoid polluting the benchmark with the filecache logic |
2385 def perfnodelookup(ui, repo, rev, **opts): | 2387 def perfnodelookup(ui, repo, rev, **opts): |
2386 opts = _byteskwargs(opts) | 2388 opts = _byteskwargs(opts) |
2387 timer, fm = gettimer(ui, opts) | 2389 timer, fm = gettimer(ui, opts) |
2388 import mercurial.revlog | 2390 import mercurial.revlog |
2389 | 2391 |
2390 mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg | 2392 mercurial.revlog._prereadsize = 2 ** 24 # disable lazy parser in old hg |
2391 n = scmutil.revsingle(repo, rev).node() | 2393 n = scmutil.revsingle(repo, rev).node() |
2392 | 2394 |
2393 try: | 2395 try: |
2394 cl = revlog(getsvfs(repo), radix=b"00changelog") | 2396 cl = revlog(getsvfs(repo), radix=b"00changelog") |
2395 except TypeError: | 2397 except TypeError: |
3098 try: | 3100 try: |
3099 if not (pre_63edc384d3b7 or post_18415fc918a1): | 3101 if not (pre_63edc384d3b7 or post_18415fc918a1): |
3100 # disable inlining | 3102 # disable inlining |
3101 old_max_inline = mercurial.revlog._maxinline | 3103 old_max_inline = mercurial.revlog._maxinline |
3102 # large enough to never happen | 3104 # large enough to never happen |
3103 mercurial.revlog._maxinline = 2**50 | 3105 mercurial.revlog._maxinline = 2 ** 50 |
3104 | 3106 |
3105 with repo.lock(): | 3107 with repo.lock(): |
3106 bundle = [None, None] | 3108 bundle = [None, None] |
3107 orig_quiet = repo.ui.quiet | 3109 orig_quiet = repo.ui.quiet |
3108 try: | 3110 try: |