From 05f1ef73b28c95ffc531e50b0474ecde8548c71a Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Thu, 16 Jan 2020 01:01:10 -0800 Subject: [PATCH] obsolete: add option for disabling evolution Summary: Allow disabling of evolution and obsolescence markers by setting `experiemental.evolution=obsolete`. Reviewed By: quark-zju Differential Revision: D19411232 fbshipit-source-id: 89601a93cff1f87d04b7230fcb6c1e91cf074e92 --- eden/scm/edenscm/mercurial/obsolete.py | 3 ++- eden/scm/tests/test-mutation-infinitepush.t | 2 +- eden/scm/tests/test-mutation-loops.t | 2 +- eden/scm/tests/test-mutation-pushrebase.t | 2 +- eden/scm/tests/test-mutation.t | 2 +- eden/scm/tests/test-visibility-bundle.t | 2 +- eden/scm/tests/test-visibility-cloudsync.t | 2 +- eden/scm/tests/test-visibility-reset.t | 2 +- eden/scm/tests/test-visibility.t | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/eden/scm/edenscm/mercurial/obsolete.py b/eden/scm/edenscm/mercurial/obsolete.py index c326c853b5..314b972dab 100644 --- a/eden/scm/edenscm/mercurial/obsolete.py +++ b/eden/scm/edenscm/mercurial/obsolete.py @@ -834,7 +834,8 @@ def makestore(ui, repo): kwargs[r"defaultformat"] = defaultformat readonly = not isenabled(repo, createmarkersopt) store = obsstore(repo.svfs, readonly=readonly, **kwargs) - if store and readonly: + obsolete = ui.config("experimental", "evolution") == "obsolete" + if store and readonly and not obsolete: ui.warn( _("obsolete feature not enabled but %i markers found!\n") % len(list(store)) ) diff --git a/eden/scm/tests/test-mutation-infinitepush.t b/eden/scm/tests/test-mutation-infinitepush.t index dfc761dcf0..b83caac32d 100644 --- a/eden/scm/tests/test-mutation-infinitepush.t +++ b/eden/scm/tests/test-mutation-infinitepush.t @@ -2,7 +2,7 @@ $ setconfig extensions.treemanifest=! $ enable amend rebase histedit fbhistedit remotenames - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig experimental.narrow-heads=true $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-mutation-loops.t b/eden/scm/tests/test-mutation-loops.t index 6a5a521de9..4baaacea3b 100644 --- a/eden/scm/tests/test-mutation-loops.t +++ b/eden/scm/tests/test-mutation-loops.t @@ -1,5 +1,5 @@ $ enable amend rebase remotenames - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig experimental.narrow-heads=true $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-mutation-pushrebase.t b/eden/scm/tests/test-mutation-pushrebase.t index 07abe4eb5c..be3b9648ad 100644 --- a/eden/scm/tests/test-mutation-pushrebase.t +++ b/eden/scm/tests/test-mutation-pushrebase.t @@ -2,7 +2,7 @@ $ setconfig extensions.treemanifest=! $ enable pushrebase amend remotenames - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig experimental.narrow-heads=true $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-mutation.t b/eden/scm/tests/test-mutation.t index 6e74a4897c..ef19a421d0 100644 --- a/eden/scm/tests/test-mutation.t +++ b/eden/scm/tests/test-mutation.t @@ -3,7 +3,7 @@ $ setconfig extensions.treemanifest=! $ enable amend rebase histedit fbhistedit phabdiff absorb $ setconfig ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ui.interactive=true - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-visibility-bundle.t b/eden/scm/tests/test-visibility-bundle.t index 5bee9423b8..b47e59aa46 100644 --- a/eden/scm/tests/test-visibility-bundle.t +++ b/eden/scm/tests/test-visibility-bundle.t @@ -1,7 +1,7 @@ #chg-compatible $ enable amend rebase remotenames - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig experimental.narrow-heads=true $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-visibility-cloudsync.t b/eden/scm/tests/test-visibility-cloudsync.t index 698762920b..c0f9f38e72 100644 --- a/eden/scm/tests/test-visibility-cloudsync.t +++ b/eden/scm/tests/test-visibility-cloudsync.t @@ -6,7 +6,7 @@ $ setconfig infinitepush.branchpattern="re:scratch/.*" $ setconfig commitcloud.hostname=testhost $ setconfig visibility.enabled=true - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig experimental.narrow-heads=true $ setconfig mutation.record=true mutation.enabled=true mutation.user=test mutation.date="0 0" $ setconfig remotefilelog.reponame=server diff --git a/eden/scm/tests/test-visibility-reset.t b/eden/scm/tests/test-visibility-reset.t index 32dcb9d229..9f2aa9e901 100644 --- a/eden/scm/tests/test-visibility-reset.t +++ b/eden/scm/tests/test-visibility-reset.t @@ -1,7 +1,7 @@ #chg-compatible $ enable amend rebase reset - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" diff --git a/eden/scm/tests/test-visibility.t b/eden/scm/tests/test-visibility.t index f2e9a9f976..617fdea71e 100644 --- a/eden/scm/tests/test-visibility.t +++ b/eden/scm/tests/test-visibility.t @@ -1,7 +1,7 @@ #chg-compatible $ enable amend rebase undo directaccess shelve - $ setconfig experimental.evolution= + $ setconfig experimental.evolution=obsolete $ setconfig visibility.enabled=true $ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0" $ setconfig hint.ack=undo