Mercurial > hg > hg-git
changeset 681:18a3dbd0306f
hgrepo.tags: drop support for Mercurial < 2.0
A new property called _tagscache was introduced in Mercurial 2.0, so the cache
wasn't actually working.
The contract for tags() also changed at some point -- it stopped returning
nodes that weren't in the repo. This will need to be accounted for if we
start using the tags cache again. However, it isn't very clear whether the
Mercurial tags cache is actually worth doing, since we already have a
separate in-memory cache for Git tags in the handler.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 19 Feb 2014 16:09:23 -0800 |
parents | cb1f40fb27fb |
children | acb429c62c28 |
files | hggit/hgrepo.py |
diffstat | 1 files changed, 1 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/hgrepo.py +++ b/hggit/hgrepo.py @@ -58,13 +58,7 @@ return {} def tags(self): - if hasattr(self, 'tagscache') and self.tagscache: - # Mercurial 1.4 and earlier. - return self.tagscache - elif hasattr(self, '_tags') and self._tags: - # Mercurial 1.5 and later. - return self._tags - + # TODO consider using self._tagscache tagscache = super(hgrepo, self).tags() tagscache.update(self.gitrefs()) for tag, rev in self.githandler.tags.iteritems(): @@ -72,9 +66,6 @@ continue tagscache[tag] = bin(rev) - if hasattr(self, '_tagstypecache'): - # Only present in Mercurial 1.3 and earlier. - self._tagstypecache[tag] = 'git' return tagscache