Show More
@@ -963,16 +963,12 b' def perfdirstatewrite(ui, repo, **opts):' | |||||
963 | timer(d) |
|
963 | timer(d) | |
964 | fm.end() |
|
964 | fm.end() | |
965 |
|
965 | |||
966 | @command(b'perfmergecalculate', |
|
966 | def _getmergerevs(repo, opts): | |
967 | [ |
|
967 | """parse command argument to return rev involved in merge | |
968 | (b'r', b'rev', b'.', b'rev to merge against'), |
|
968 | ||
969 | (b'', b'from', b'', b'rev to merge from'), |
|
969 | input: options dictionnary with `rev`, `from` and `bse` | |
970 | (b'', b'base', b'', b'the revision to use as base'), |
|
970 | output: (localctx, otherctx, basectx) | |
971 | ] + formatteropts) |
|
971 | """ | |
972 | def perfmergecalculate(ui, repo, rev, **opts): |
|
|||
973 | opts = _byteskwargs(opts) |
|
|||
974 | timer, fm = gettimer(ui, opts) |
|
|||
975 |
|
||||
976 | if opts['from']: |
|
972 | if opts['from']: | |
977 | fromrev = scmutil.revsingle(repo, opts['from']) |
|
973 | fromrev = scmutil.revsingle(repo, opts['from']) | |
978 | wctx = repo[fromrev] |
|
974 | wctx = repo[fromrev] | |
@@ -981,19 +977,25 b' def perfmergecalculate(ui, repo, rev, **' | |||||
981 | # we don't want working dir files to be stat'd in the benchmark, so |
|
977 | # we don't want working dir files to be stat'd in the benchmark, so | |
982 | # prime that cache |
|
978 | # prime that cache | |
983 | wctx.dirty() |
|
979 | wctx.dirty() | |
984 | rctx = scmutil.revsingle(repo, rev, rev) |
|
980 | rctx = scmutil.revsingle(repo, opts['rev'], opts['rev']) | |
985 | if opts['base']: |
|
981 | if opts['base']: | |
986 | fromrev = scmutil.revsingle(repo, opts['base']) |
|
982 | fromrev = scmutil.revsingle(repo, opts['base']) | |
987 | ancestor = repo[fromrev] |
|
983 | ancestor = repo[fromrev] | |
988 | else: |
|
984 | else: | |
989 | ancestor = wctx.ancestor(rctx) |
|
985 | ancestor = wctx.ancestor(rctx) | |
990 | def d(): |
|
986 | return (wctx, rctx, ancestor) | |
991 | # acceptremote is True because we don't want prompts in the middle of |
|
987 | ||
992 | # our benchmark |
|
988 | @command(b'perfmergecalculate', | |
993 | merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False, |
|
989 | [ | |
994 | acceptremote=True, followcopies=True) |
|
990 | (b'r', b'rev', b'.', b'rev to merge against'), | |
995 | timer(d) |
|
991 | (b'', b'from', b'', b'rev to merge from'), | |
996 | fm.end() |
|
992 | (b'', b'base', b'', b'the revision to use as base'), | |
|
993 | ] + formatteropts) | |||
|
994 | def perfmergecalculate(ui, repo, **opts): | |||
|
995 | opts = _byteskwargs(opts) | |||
|
996 | timer, fm = gettimer(ui, opts) | |||
|
997 | ||||
|
998 | wctx, rctx, ancestor = _getmergerevs(repo, opts) | |||
997 | def d(): |
|
999 | def d(): | |
998 | # acceptremote is True because we don't want prompts in the middle of |
|
1000 | # acceptremote is True because we don't want prompts in the middle of | |
999 | # our benchmark |
|
1001 | # our benchmark |
General Comments 0
You need to be logged in to leave comments.
Login now