Patchwork D1868: evolution: make reporting of new unstable changesets optional

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2018, 8:15 p.m.
Message ID <differential-rev-PHID-DREV-u7jbvseh5r5z66rc3hnm-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26797/
State Superseded
Headers show

Comments

phabricator - Jan. 16, 2018, 8:15 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes it possible to turn off the reporting of unstable
  changesets (e.g. "1 new orphan changesets"), just in case it's too
  slow for some users. Anyone who's been using the evolve extension has
  already been accepting the cost of the reporting, so this is just for
  the few users who have turned on obsmarkers but not been using the
  evolve extension (as I believe Facebook has).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/scmutil.py
  tests/test-obsolete.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -340,6 +340,17 @@ 
 
   $ cd ..
 
+Can disable transaction summary report
+
+  $ hg init transaction-summary
+  $ cd transaction-summary
+  $ mkcommit a
+  $ mkcommit b
+  $ hg up -q null
+  $ hg --config experimental.evolution.report-instabilities=false debugobsolete `getid a`
+  obsoleted 1 changesets
+  $ cd ..
+
 Exchange Test
 ============================
 
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1260,7 +1260,8 @@ 
                 repo.ui.status(_('obsoleted %i changesets\n')
                                % len(obsoleted))
 
-    if obsolete.isenabled(repo, obsolete.createmarkersopt):
+    if (obsolete.isenabled(repo, obsolete.createmarkersopt) and
+        repo.ui.configbool('experimental', 'evolution.report-instabilities')):
         instabilitytypes = [
             ('orphan', 'orphan'),
             ('phase-divergent', 'phasedivergent'),
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -487,6 +487,9 @@ 
 coreconfigitem('experimental', 'evolution.track-operation',
     default=True,
 )
+coreconfigitem('experimental', 'evolution.report-instabilities',
+    default=True,
+)
 coreconfigitem('experimental', 'worddiff',
     default=False,
 )