diff mercurial/branchmap.py @ 20032:175c6fd8cacc

subsettable: move from repoview to branchmap, the only place it's used This is a step towards breaking an import cycle between revset and repoview. Import cycles happened to work in Python 2 with implicit relative imports, but breaks on Python 3 when we start using explicit relative imports via 2to3 rewrite rules.
author Augie Fackler <raf@durin42.com>
date Wed, 06 Nov 2013 14:38:34 -0500
parents a32ef044b99a
children b9515fb9e72a
line wrap: on
line diff
--- a/mercurial/branchmap.py	Sat Nov 16 20:12:02 2013 -0500
+++ b/mercurial/branchmap.py	Wed Nov 06 14:38:34 2013 -0500
@@ -7,7 +7,7 @@
 
 from node import bin, hex, nullid, nullrev
 import encoding
-import util, repoview
+import util
 
 def _filename(repo):
     """name of a branchcache file for a given repo or repoview"""
@@ -58,6 +58,17 @@
 
 
 
+### Nearest subset relation
+# Nearest subset of filter X is a filter Y so that:
+# * Y is included in X,
+# * X - Y is as small as possible.
+# This create and ordering used for branchmap purpose.
+# the ordering may be partial
+subsettable = {None: 'visible',
+               'visible': 'served',
+               'served': 'immutable',
+               'immutable': 'base'}
+
 def updatecache(repo):
     cl = repo.changelog
     filtername = repo.filtername
@@ -67,7 +78,7 @@
     if partial is None or not partial.validfor(repo):
         partial = read(repo)
         if partial is None:
-            subsetname = repoview.subsettable.get(filtername)
+            subsetname = subsettable.get(filtername)
             if subsetname is None:
                 partial = branchcache()
             else: