[PATCH 2 of 3 clfilter-part2] clfilter: do not use tags cache if there are filtered changesets

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 27 18:12:12 CDT 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1346675705 -7200
# Node ID 730611d938032350c755497ba5f478d0f1fbbdd3
# Parent  5069142f9735c4a541147d24295af084f9af86a5
clfilter: do not use tags cache if there are filtered changesets

If there are filtered changesets the cache is not valid. We'll have to cache
tags for filtered state too, but for now recomputing the tags is enough.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -516,7 +516,11 @@
     def tags(self):
         '''return a mapping of tag to node'''
         t = {}
-        for k, v in self._tagscache.tags.iteritems():
+        if self.changelog.filteredrevs:
+            tags, tt = self._findtags()
+        else:
+            tags = self._tagscache.tags
+        for k, v in tags.iteritems():
             try:
                 # ignore tags to unknown nodes
                 self.changelog.rev(v)


More information about the Mercurial-devel mailing list