##// END OF EJS Templates
clfilter: add impactable filter...
Pierre-Yves David -
r18246:58ca19ed default
parent child Browse files
Show More
@@ -40,10 +40,34 b' def computemutable(repo):'
40 40 return frozenset(repo.revs('draft() + secret()'))
41 41 return frozenset()
42 42
43 def computeimpactable(repo):
44 """Everything impactable by mutable revision
45
46 The mutable filter still have some chance to get invalidated. This will
47 happen when:
48
49 - you garbage collect hidden changeset,
50 - public phase is moved backward,
51 - something is changed in the filtering (this could be fixed)
52
53 This filter out any mutable changeset and any public changeset that may be
54 impacted by something happening to a mutable revision.
55
56 This is achieved by filtered everything with a revision number egal or
57 higher than the first mutable changeset is filtered."""
58 assert not repo.changelog.filteredrevs
59 cl = repo.changelog
60 firstmutable = len(cl)
61 for roots in repo._phasecache.phaseroots[1:]:
62 if roots:
63 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
64 return frozenset(xrange(firstmutable, len(cl)))
65
43 66 # function to compute filtered set
44 67 filtertable = {'hidden': computehidden,
45 68 'unserved': computeunserved,
46 'mutable': computemutable}
69 'mutable': computemutable,
70 'impactable': computeimpactable}
47 71 ### Nearest subset relation
48 72 # Nearest subset of filter X is a filter Y so that:
49 73 # * Y is included in X,
@@ -52,7 +76,8 b" filtertable = {'hidden': computehidden,"
52 76 # the ordering may be partial
53 77 subsettable = {None: 'hidden',
54 78 'hidden': 'unserved',
55 'unserved': 'mutable'}
79 'unserved': 'mutable',
80 'mutable': 'impactable'}
56 81
57 82 def filteredrevs(repo, filtername):
58 83 """returns set of filtered revision for this filter name"""
@@ -111,7 +111,7 b' group can still write everything'
111 111 00770 ../push/.hg/
112 112 00660 ../push/.hg/00changelog.i
113 113 00770 ../push/.hg/cache/
114 00660 ../push/.hg/cache/branchheads-mutable
114 00660 ../push/.hg/cache/branchheads-impactable
115 115 00660 ../push/.hg/requires
116 116 00770 ../push/.hg/store/
117 117 00660 ../push/.hg/store/00changelog.i
@@ -176,7 +176,7 b' Pushing just rev 0:'
176 176 $ hg push -qr 0 ../target
177 177
178 178 $ (cd ../target/; listbranchcaches)
179 === .hg/cache/branchheads-mutable ===
179 === .hg/cache/branchheads-impactable ===
180 180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
181 181 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
182 182
@@ -185,7 +185,7 b' Pushing everything:'
185 185 $ hg push -qf ../target
186 186
187 187 $ (cd ../target/; listbranchcaches)
188 === .hg/cache/branchheads-mutable ===
188 === .hg/cache/branchheads-impactable ===
189 189 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
190 190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
191 191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
General Comments 0
You need to be logged in to leave comments. Login now