# HG changeset patch # User Laurent Charignon # Date 2015-03-30 19:57:55 # Node ID 34e8bfc21f944c3d42c6184ee9537f35db1afa15 # Parent de3acfabaddcf1e9f3d6a4bd9ed8579fe3b9f870 phases: add killswitch for native implementation diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -195,7 +195,11 @@ class phasecache(object): def getphaserevs(self, repo): if self._phaserevs is None: try: - self._phaserevs = self.getphaserevsnative(repo) + if repo.ui.configbool('experimental', + 'nativephaseskillswitch'): + self.computephaserevspure(repo) + else: + self._phaserevs = self.getphaserevsnative(repo) except AttributeError: self.computephaserevspure(repo) return self._phaserevs diff --git a/tests/test-phases.t b/tests/test-phases.t --- a/tests/test-phases.t +++ b/tests/test-phases.t @@ -456,8 +456,12 @@ move changeset backward o 0 public A -move changeset forward and backward +move changeset forward and backward and test kill switch + $ cat <> $HGRCPATH + > [experimental] + > nativephaseskillswitch = true + > EOF $ hg phase --draft --force 1::4 $ hg log -G --template "{rev} {phase} {desc}\n" @ 7 secret merge B' and E @@ -478,6 +482,10 @@ move changeset forward and backward test partial failure + $ cat <> $HGRCPATH + > [experimental] + > nativephaseskillswitch = false + > EOF $ hg phase --public 7 $ hg phase --draft '5 or 7' cannot move 1 changesets to a higher phase, use --force