Patchwork [1,of,6] perftest: drop duplicated codes

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 4, 2013, 6:28 p.m.
Message ID <7560e9d1c35cfe6cee78.1357324128@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/394/
State Accepted
Commit 819520ca213d3a71e447dbe8504c6a1a0bc9b65f
Headers show

Comments

Pierre-Yves David - Jan. 4, 2013, 6:28 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357323492 -3600
# Node ID 7560e9d1c35cfe6cee78fa023f360f91aca8e0a6
# Parent  11a3423dd8baebc31f912d69d160394f15140dc9
perftest: drop duplicated codes

The `perfnodelookup` lookup commands is duplicated. We drop the first version,
overwritten by the seconds.
Pierre-Yves David - Jan. 4, 2013, 7:22 p.m.
I forget to include the first changeset of the series :-/

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -155,19 +155,10 @@  def perfrevrange(ui, repo, *specs):
 
 def perfnodelookup(ui, repo, rev):
     import mercurial.revlog
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
     n = repo[rev].node()
-    def d():
-        cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
-        cl.rev(n)
-    timer(d)
-
-def perfnodelookup(ui, repo, rev):
-    import mercurial.revlog
-    mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
-    n = repo[rev].node()
     cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
     def d():
         cl.rev(n)
         clearcaches(cl)
     timer(d)