1137 # util function (avoid attribute lookup in the loop) |
1137 # util function (avoid attribute lookup in the loop) |
1138 phase = repo._phasecache.phase # would be faster to grab the full list |
1138 phase = repo._phasecache.phase # would be faster to grab the full list |
1139 public = phases.public |
1139 public = phases.public |
1140 cl = repo.changelog |
1140 cl = repo.changelog |
1141 torev = cl.nodemap.get |
1141 torev = cl.nodemap.get |
1142 obs = getrevs(repo, 'obsolete') |
1142 for ctx in repo.set('(not public()) and (not obsolete())'): |
1143 for rev in repo: |
1143 rev = ctx.rev() |
1144 # We only evaluate mutable, non-obsolete revision |
1144 # We only evaluate mutable, non-obsolete revision |
1145 if (public < phase(repo, rev)) and (rev not in obs): |
1145 node = ctx.node() |
1146 node = cl.node(rev) |
1146 # (future) A cache of precursors may worth if split is very common |
1147 # (future) A cache of precursors may worth if split is very common |
1147 for pnode in allprecursors(repo.obsstore, [node], |
1148 for pnode in allprecursors(repo.obsstore, [node], |
1148 ignoreflags=bumpedfix): |
1149 ignoreflags=bumpedfix): |
1149 prev = torev(pnode) # unfiltered! but so is phasecache |
1150 prev = torev(pnode) # unfiltered! but so is phasecache |
1150 if (prev is not None) and (phase(repo, prev) <= public): |
1151 if (prev is not None) and (phase(repo, prev) <= public): |
1151 # we have a public precursors |
1152 # we have a public precursors |
1152 bumped.add(rev) |
1153 bumped.add(rev) |
1153 break # Next draft! |
1154 break # Next draft! |
|
1155 return bumped |
1154 return bumped |
1156 |
1155 |
1157 @cachefor('divergent') |
1156 @cachefor('divergent') |
1158 def _computedivergentset(repo): |
1157 def _computedivergentset(repo): |
1159 """the set of rev that compete to be the final successors of some revision. |
1158 """the set of rev that compete to be the final successors of some revision. |