Patchwork D6746: perf: don't pass experimental argument in config for older Mercurial versions

login
register
mail settings
Submitter phabricator
Date Aug. 20, 2019, 2:30 p.m.
Message ID <differential-rev-PHID-DREV-u7m2tqjur7sftj53k7gl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41355/
State Superseded
Headers show

Comments

phabricator - Aug. 20, 2019, 2:30 p.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is a follow-up patch to a11fd395e83f <https://phab.mercurial-scm.org/rHGa11fd395e83fb82420aef049b69bdba8d722c4f1>. This patch makes older Mercurial
  versions to not use `experimental` argument in config options.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 20, 2019, 2:34 p.m.
pulkit added inline comments.

INLINE COMMENTS

> perf.py:270
>      pass
> +except TypeError:
> +    configitem(b'perf', b'presleep',

Can you add the commit hash and hg version (5.2 in this case) as comment due to which the compatibility is need?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6746/new/

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

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Aug. 20, 2019, 3:29 p.m.
martinvonz added a comment.


  When this patch is ready, could we fold this into `a11fd395e83f`? I have `extensions.perf=contrib/perf.py` in my config and it's pretty annoying to have any commit in the broken range checked out.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6746/new/

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

To: navaneeth.suresh, #hg-reviewers
Cc: martinvonz, pulkit, mercurial-devel
phabricator - Aug. 20, 2019, 3:38 p.m.
pulkit added a comment.


  In D6746#99035 <https://phab.mercurial-scm.org/D6746#99035>, @martinvonz wrote:
  
  > When this patch is ready, could we fold this into `a11fd395e83f`? I have `extensions.perf=contrib/perf.py` in my config and it's pretty annoying to have any commit in the broken range checked out.
  
  Folding this into `a11fd395e83f`.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6746/new/

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

To: navaneeth.suresh, #hg-reviewers
Cc: martinvonz, pulkit, mercurial-devel
phabricator - Aug. 20, 2019, 4:03 p.m.
pulkit added a comment.


  Folded https://www.mercurial-scm.org/repo/hg-committed/rev/9f2189b6bf2a. This can be closed now. Thanks for the quick fix.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6746/new/

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

To: navaneeth.suresh, #hg-reviewers, pulkit
Cc: martinvonz, pulkit, mercurial-devel

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -267,6 +267,28 @@ 
     )
 except (ImportError, AttributeError):
     pass
+except TypeError:
+    configitem(b'perf', b'presleep',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'stub',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'parentscount',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'all-timing',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'pre-run',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'profile-benchmark',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'run-limits',
+        default=mercurial.configitems.dynamicdefault,
+    )
 
 def getlen(ui):
     if ui.configbool(b"perf", b"stub", False):