Siddharth Agarwal committed 2e9fe9e

perf: add a command to test copies.pathcopies perf

An upcoming patch will improve the performance of this function, and this
command will be used to demonstrate that improvement.

Comments (0)

Files changed (1)

 '''helper extension to measure performance'''
 from mercurial import cmdutil, scmutil, util, match, commands, obsolete
-from mercurial import repoview, branchmap, merge
+from mercurial import repoview, branchmap, merge, copies
 import time, os, sys
 cmdtable = {}
+@command('perfpathcopies', [], "REV REV")
+def perfpathcopies(ui, repo, rev1, rev2):
+    ctx1 = scmutil.revsingle(repo, rev1, rev1)
+    ctx2 = scmutil.revsingle(repo, rev2, rev2)
+    def d():
+        copies.pathcopies(ctx1, ctx2)
+    timer(d)
 def perfmanifest(ui, repo):
     def d():