Show More
@@ -40,6 +40,7 b' unpack_from = struct.unpack_from' | |||||
40 | subsettable = {None: 'visible', |
|
40 | subsettable = {None: 'visible', | |
41 | 'visible-hidden': 'visible', |
|
41 | 'visible-hidden': 'visible', | |
42 | 'visible': 'served', |
|
42 | 'visible': 'served', | |
|
43 | 'served.hidden': 'served', | |||
43 | 'served': 'immutable', |
|
44 | 'served': 'immutable', | |
44 | 'immutable': 'base'} |
|
45 | 'immutable': 'base'} | |
45 |
|
46 |
@@ -86,6 +86,14 b' def computehidden(repo, visibilityexcept' | |||||
86 | _revealancestors(pfunc, hidden, visible) |
|
86 | _revealancestors(pfunc, hidden, visible) | |
87 | return frozenset(hidden) |
|
87 | return frozenset(hidden) | |
88 |
|
88 | |||
|
89 | def computesecret(repo, visibilityexceptions=None): | |||
|
90 | """compute the set of revision that can never be exposed through hgweb | |||
|
91 | ||||
|
92 | Changeset in the secret phase (or above) should stay unaccessible.""" | |||
|
93 | assert not repo.changelog.filteredrevs | |||
|
94 | secrets = repo._phasecache.getrevset(repo, phases.remotehiddenphases) | |||
|
95 | return frozenset(secrets) | |||
|
96 | ||||
89 | def computeunserved(repo, visibilityexceptions=None): |
|
97 | def computeunserved(repo, visibilityexceptions=None): | |
90 | """compute the set of revision that should be filtered when used a server |
|
98 | """compute the set of revision that should be filtered when used a server | |
91 |
|
99 | |||
@@ -93,9 +101,9 b' def computeunserved(repo, visibilityexce' | |||||
93 | assert not repo.changelog.filteredrevs |
|
101 | assert not repo.changelog.filteredrevs | |
94 | # fast path in simple case to avoid impact of non optimised code |
|
102 | # fast path in simple case to avoid impact of non optimised code | |
95 | hiddens = filterrevs(repo, 'visible') |
|
103 | hiddens = filterrevs(repo, 'visible') | |
96 |
secrets = |
|
104 | secrets = filterrevs(repo, 'served.hidden') | |
97 | if secrets: |
|
105 | if secrets: | |
98 |
return frozenset(hiddens | |
|
106 | return frozenset(hiddens | secrets) | |
99 | else: |
|
107 | else: | |
100 | return hiddens |
|
108 | return hiddens | |
101 |
|
109 | |||
@@ -141,6 +149,7 b' def computeimpactable(repo, visibilityex' | |||||
141 | # from scratch (very slow). |
|
149 | # from scratch (very slow). | |
142 | filtertable = {'visible': computehidden, |
|
150 | filtertable = {'visible': computehidden, | |
143 | 'visible-hidden': computehidden, |
|
151 | 'visible-hidden': computehidden, | |
|
152 | 'served.hidden': computesecret, | |||
144 | 'served': computeunserved, |
|
153 | 'served': computeunserved, | |
145 | 'immutable': computemutable, |
|
154 | 'immutable': computemutable, | |
146 | 'base': computeimpactable} |
|
155 | 'base': computeimpactable} |
General Comments 0
You need to be logged in to leave comments.
Login now