bookmarks: add invalidate() to bookmark_repo
Cached bookmark information would not be reset when repo.invalidate()
was called, meaning (for instanced) guis would be left with out-of-date
bookmark info. This patch fixes that by overriding bookmark_repo.invalidate()
--- a/hgext/bookmarks.py Tue Jan 12 22:49:10 2010 +0900
+++ b/hgext/bookmarks.py Thu Dec 17 15:53:28 2009 -0800
@@ -296,6 +296,13 @@
tags.update(self._bookmarks)
return (tags, tagtypes)
+ if hasattr(repo, 'invalidate'):
+ def invalidate(self):
+ super(bookmark_repo, self).invalidate()
+ for attr in ('_bookmarks', '_bookmarkcurrent'):
+ if attr in self.__dict__:
+ delattr(repo, attr)
+
repo.__class__ = bookmark_repo
def uisetup(ui):