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