Patchwork D3083: perf: make perfmanifest and perfnodelookup work with revsets

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 10:53 p.m.
Message ID <differential-rev-PHID-DREV-h3745zmxp7hdj54ojlrt-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30299/
State Superseded
Headers show

Comments

phabricator - April 4, 2018, 10:53 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  They were using repo[rev], which only works with a single symbol
  (e.g. "." or "my-bookmark"), not general revsets. Switch them to
  scmutil.revsingle() so they can also be used with e.g. ".^".
  
  I don't actually care about these commands, but I want to remove uses
  of repo[<string>].

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3083

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -767,7 +767,7 @@ 
 @command('perfchangeset', formatteropts)
 def perfchangeset(ui, repo, rev, **opts):
     timer, fm = gettimer(ui, opts)
-    n = repo[rev].node()
+    n = scmutil.revsingle(repo, rev).node()
     def d():
         repo.changelog.read(n)
         #repo.changelog._cache = None
@@ -853,7 +853,7 @@ 
     timer, fm = gettimer(ui, opts)
     import mercurial.revlog
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
-    n = repo[rev].node()
+    n = scmutil.revsingle(repo, rev).node()
     cl = mercurial.revlog.revlog(getsvfs(repo), "00changelog.i")
     def d():
         cl.rev(n)