site

(Pierre-Yves David)
2011-12-22: add an option to ensure unstable are secret

add an option to ensure unstable are secret

diff --git a/hgext/obsolete.py b/hgext/obsolete.py
--- a/hgext/obsolete.py
+++ b/hgext/obsolete.py
@@ -92,6 +92,7 @@ from mercurial import discovery
 from mercurial import error
 from mercurial import commands
 from mercurial import changelog
+from mercurial import phases
 from mercurial.node import hex, bin, short, nullid
 from mercurial.lock import release
 
@@ -495,4 +496,12 @@ def reposetup(ui, repo):
 
 
     repo.__class__ = obsoletingrepo
+    obsoletes = [c.node() for c in repo.set('obsolete() - public()')]
+    lock = repo.lock()
+    if repo.ui.configbool('obsolete', 'secret-unstable', True):
+        try:
+            phases.retractboundary(repo, 2, obsoletes)
+        finally:
+            lock.release()
 
+