Mercurial > hg
diff hgext/bookmarks.py @ 8944:dda4ad7c9ea9
bookmarks: Change references to "repo" by references to "self" (issue1611)
Using "repo" instead of "self" inside bookmark_repo methods was causing a
circular reference and, thus, a memory leak. It has been detected because the
method bundlerepository.__del__ is never called, therefore leaving dangling
uncompressed bundles inside .hg subdirectory.
author | Isaac Jurado <diptongo@gmail.com> |
---|---|
date | Wed, 24 Jun 2009 19:20:59 +0200 |
parents | 868670dbc237 |
children | 6d0b5d76e76d |
line wrap: on
line diff
--- a/hgext/bookmarks.py Tue Jun 23 22:20:54 2009 -0400 +++ b/hgext/bookmarks.py Wed Jun 24 19:20:59 2009 +0200 @@ -257,14 +257,14 @@ node = super(bookmark_repo, self).commit(*k, **kw) if node is None: return None - parents = repo.changelog.parents(node) + parents = self.changelog.parents(node) if parents[1] == nullid: parents = (parents[0],) - marks = parse(repo) + marks = parse(self) update = False for mark, n in marks.items(): if ui.configbool('bookmarks', 'track.current'): - if mark == current(repo) and n in parents: + if mark == current(self) and n in parents: marks[mark] = node update = True else: @@ -272,28 +272,28 @@ marks[mark] = node update = True if update: - write(repo, marks) + write(self, marks) return node finally: wlock.release() def addchangegroup(self, source, srctype, url, emptyok=False): - parents = repo.dirstate.parents() + parents = self.dirstate.parents() result = super(bookmark_repo, self).addchangegroup( source, srctype, url, emptyok) if result > 1: # We have more heads than before return result - node = repo.changelog.tip() - marks = parse(repo) + node = self.changelog.tip() + marks = parse(self) update = False for mark, n in marks.items(): if n in parents: marks[mark] = node update = True if update: - write(repo, marks) + write(self, marks) return result def tags(self): @@ -302,7 +302,7 @@ return self.tagscache tagscache = super(bookmark_repo, self).tags() - tagscache.update(parse(repo)) + tagscache.update(parse(self)) return tagscache repo.__class__ = bookmark_repo