contrib/perf.py
changeset 42384 f5f0a9490c05
parent 42383 3a3592b40a95
child 42385 21c436a3a4e8
equal deleted inserted replaced
42383:3a3592b40a95 42384:f5f0a9490c05
  1002         merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False,
  1002         merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False,
  1003                                acceptremote=True, followcopies=True)
  1003                                acceptremote=True, followcopies=True)
  1004     timer(d)
  1004     timer(d)
  1005     fm.end()
  1005     fm.end()
  1006 
  1006 
       
  1007 @command(b'perfmergecopies',
       
  1008          [
       
  1009              (b'r', b'rev', b'.', b'rev to merge against'),
       
  1010              (b'', b'from', b'', b'rev to merge from'),
       
  1011              (b'', b'base', b'', b'the revision to use as base'),
       
  1012          ] + formatteropts)
       
  1013 def perfmergecopies(ui, repo, **opts):
       
  1014     """measure runtime of `copies.mergecopies`"""
       
  1015     opts = _byteskwargs(opts)
       
  1016     timer, fm = gettimer(ui, opts)
       
  1017     wctx, rctx, ancestor = _getmergerevs(repo, opts)
       
  1018     def d():
       
  1019         # acceptremote is True because we don't want prompts in the middle of
       
  1020         # our benchmark
       
  1021         copies.mergecopies(repo, wctx, rctx, ancestor)
       
  1022     timer(d)
       
  1023     fm.end()
       
  1024 
  1007 @command(b'perfpathcopies', [], b"REV REV")
  1025 @command(b'perfpathcopies', [], b"REV REV")
  1008 def perfpathcopies(ui, repo, rev1, rev2, **opts):
  1026 def perfpathcopies(ui, repo, rev1, rev2, **opts):
  1009     """benchmark the copy tracing logic"""
  1027     """benchmark the copy tracing logic"""
  1010     opts = _byteskwargs(opts)
  1028     opts = _byteskwargs(opts)
  1011     timer, fm = gettimer(ui, opts)
  1029     timer, fm = gettimer(ui, opts)