obsolete: blindly obsolete unstability cache when changeset are added
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 23 Apr 2012 18:53:26 +0200
changeset 210 168ea7d200a0
parent 209 7bee48a54c4a
child 211 69a37d56c7fb
obsolete: blindly obsolete unstability cache when changeset are added
hgext/obsolete.py
--- a/hgext/obsolete.py	Mon Apr 23 17:25:36 2012 +0200
+++ b/hgext/obsolete.py	Mon Apr 23 18:53:26 2012 +0200
@@ -365,6 +365,7 @@
     opush = repo.push
     o_rollback = repo._rollback
     ocancopy = repo.cancopy
+    o_updatebranchcache = repo.updatebranchcache
 
     # /!\ api change in  Hg 2.2 (97efd26eb9576f39590812ea9) /!\
     if util.safehasattr(repo, '_journalfiles'): # Hg 2.2
@@ -419,6 +420,13 @@
                 del self._obssubrels
             if '_obsoleteset' in vars(self):
                 del self._obsoleteset
+            self._clearunstablecache()
+
+        def updatebranchcache(self):
+            o_updatebranchcache()
+            self._clearunstablecache()
+
+        def _clearunstablecache(self):
             if '_unstableset' in vars(self):
                 del self._unstableset
             if '_suspendedset' in vars(self):