Mercurial > hg
diff hgext/bookmarks.py @ 12747:175fb1b193f4
bookmarks: better fix for issue2016 (lookup infinite recursion)
741290486877 partially reverted by Patrick Mézard <pmezard@gmail.com>
author | Paul Molodowitch <pm@stanfordalumni.org> |
---|---|
date | Thu, 07 Oct 2010 13:44:17 -0700 |
parents | f5178fbcd197 |
children | 4212fdc4db18 |
line wrap: on
line diff
--- a/hgext/bookmarks.py Mon Aug 02 07:15:47 2010 +0300 +++ b/hgext/bookmarks.py Thu Oct 07 13:44:17 2010 -0700 @@ -225,15 +225,13 @@ in the .hg/bookmarks file. Read the file and return a (name=>nodeid) dictionary ''' - self._loadingbookmarks = True try: bookmarks = {} for line in self.opener('bookmarks'): sha, refspec = line.strip().split(' ', 1) - bookmarks[refspec] = super(bookmark_repo, self).lookup(sha) + bookmarks[refspec] = self.changelog.lookup(sha) except: pass - self._loadingbookmarks = False return bookmarks @util.propertycache @@ -260,9 +258,8 @@ return super(bookmark_repo, self).rollback(*args) def lookup(self, key): - if not getattr(self, '_loadingbookmarks', False): - if key in self._bookmarks: - key = self._bookmarks[key] + if key in self._bookmarks: + key = self._bookmarks[key] return super(bookmark_repo, self).lookup(key) def _bookmarksupdate(self, parents, node): @@ -361,8 +358,7 @@ def _findtags(self): """Merge bookmarks with normal tags""" (tags, tagtypes) = super(bookmark_repo, self)._findtags() - if not getattr(self, '_loadingbookmarks', False): - tags.update(self._bookmarks) + tags.update(self._bookmarks) return (tags, tagtypes) if hasattr(repo, 'invalidate'):