perf: add a command to test copies.pathcopies perf
authorSiddharth Agarwal <sid0@fb.com>
Thu, 04 Apr 2013 20:36:46 -0700
changeset 18877 2e9fe9e2671f
parent 18872 16b34391819d
child 18878 3cfaace0441e
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.
contrib/perf.py
--- a/contrib/perf.py	Wed Apr 03 17:04:38 2013 -0700
+++ b/contrib/perf.py	Thu Apr 04 20:36:46 2013 -0700
@@ -2,7 +2,7 @@
 '''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 = {}
@@ -158,6 +158,14 @@
                                acceptremote=True)
     timer(d)
 
+@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)
+
 @command('perfmanifest')
 def perfmanifest(ui, repo):
     def d():