Patchwork [11,of,18,V2] branchmap: disable fallback to unfiltered branchcache

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 4, 2013, 1:04 a.m.
Message ID <7fdca0e69744a4eca0b6.1357261454@yamac.lan>
Download mbox | patch
Permalink /patch/380/
State Accepted
Commit 47f00b0de3372d7cbea8333e617a572bc43df057
Headers show

Comments

Pierre-Yves David - Jan. 4, 2013, 1:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1357087017 -3600
# Node ID 7fdca0e69744a4eca0b6ac648a747f0013290fc9
# Parent  9cc61b186ab76a50d1c896351d08d55ebd4e6bb9
branchmap: disable fallback to unfiltered branchcache

Disables this simple optimisation to allow coming more powerfull approach: cache
collaboration.

Our goal is to have branchcache collaborate. This means that unfiltered
branchcache will fallback to some filtered branchcache if invalid. We can't have
the filtered branchcache to use the unfiltered one. That would loop.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -650,12 +650,10 @@  class localrepository(object):
                 marks.append(bookmark)
         return sorted(marks)
 
     def branchmap(self):
         '''returns a dictionary {branch: [branchheads]}'''
-        if self.filtername and not self.changelog.filteredrevs:
-            return self.unfiltered().branchmap()
         branchmap.updatecache(self)
         return self._branchcaches[self.filtername]
 
 
     def _branchtip(self, heads):
diff --git a/tests/test-acl.t b/tests/test-acl.t
--- a/tests/test-acl.t
+++ b/tests/test-acl.t
@@ -138,11 +138,10 @@  Extension disabled for lack of acl.sourc
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -200,11 +199,10 @@  No [acl.allow]/[acl.deny]
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -272,11 +270,10 @@  Empty [acl.allow]
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -771,11 +768,10 @@  wilma can change files with a .txt exten
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1089,11 +1085,10 @@  fred is always allowed
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1165,11 +1160,10 @@  no one is allowed inside foo/Bar/
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1317,11 +1311,10 @@  OS-level groups
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   3 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1515,11 +1508,10 @@  Branch acl deny test
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   4 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1827,11 +1819,10 @@  push foobar into the remote
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   4 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -1915,11 +1906,10 @@  Branch acl conflicting deny
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   4 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
@@ -2071,11 +2061,10 @@  Non-astro users must be denied
   """
   pushing to ../b
   query 1; heads
   searching for changes
   all remote heads known locally
-  invalid branchheads cache: tip differs
   listing keys for "bookmarks"
   4 changesets found
   list of changesets:
   ef1ea85a6374b77d6da9dcda9541f498f2d17df7
   f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd