add an option to ensure unstable are secret
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 22 Dec 2011 15:26:42 +0100
changeset 115 d60eddda9546
parent 114 1a64195e2b09
child 116 64ca29eef349
add an option to ensure unstable are secret
hgext/obsolete.py
--- a/hgext/obsolete.py	Mon Dec 19 16:27:00 2011 +0100
+++ b/hgext/obsolete.py	Thu Dec 22 15:26:42 2011 +0100
@@ -92,6 +92,7 @@
 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 @@
 
 
     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()
 
+