obsolete: clever obsolete not in secret detection to avoid locking the repo without a reason.
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sat, 07 Jan 2012 15:45:40 +0100
changeset 124 c6af5921bb74
parent 123 36b27bd12aef
child 125 4d6eef4947b3
obsolete: clever obsolete not in secret detection to avoid locking the repo without a reason.
hgext/obsolete.py
--- a/hgext/obsolete.py	Sat Jan 07 11:40:45 2012 +0100
+++ b/hgext/obsolete.py	Sat Jan 07 15:45:40 2012 +0100
@@ -497,11 +497,12 @@
 
     repo.__class__ = obsoletingrepo
     if repo.ui.configbool('obsolete', 'secret-unstable', True):
-        obsoletes = [c.node() for c in repo.set('obsolete()')]
-        lock = repo.lock()
-        try:
-            phases.retractboundary(repo, 2, obsoletes)
-        finally:
-            lock.release()
+        expobs = [c.node() for c in repo.set('obsolete() - secret()')]
+        if expobs: # do not lock in nothing move. locking for peanut make hgview reload on any command
+            lock = repo.lock()
+            try:
+                phases.retractboundary(repo, 2, expobs)
+            finally:
+                lock.release()