##// END OF EJS Templates
obsolete: speed up unstable computation...
Laurent Charignon -
r24928:876a2ebf default
parent child Browse files
Show More
@@ -1110,13 +1110,17 b' def _computeobsoleteset(repo):'
1110 @cachefor('unstable')
1110 @cachefor('unstable')
1111 def _computeunstableset(repo):
1111 def _computeunstableset(repo):
1112 """the set of non obsolete revisions with obsolete parents"""
1112 """the set of non obsolete revisions with obsolete parents"""
1113 # revset is not efficient enough here
1113 revs = [(ctx.rev(), ctx) for ctx in
1114 # we do (obsolete()::) - obsolete() by hand
1114 repo.set('(not public()) and (not obsolete())')]
1115 obs = getrevs(repo, 'obsolete')
1115 revs.sort(key=lambda x:x[0])
1116 if not obs:
1116 unstable = set()
1117 return set()
1117 for rev, ctx in revs:
1118 cl = repo.changelog
1118 # A rev is unstable if one of its parent is obsolete or unstable
1119 return set(r for r in cl.descendants(obs) if r not in obs)
1119 # this works since we traverse following growing rev order
1120 if util.any((x.obsolete() or (x.rev() in unstable))
1121 for x in ctx.parents()):
1122 unstable.add(rev)
1123 return unstable
1120
1124
1121 @cachefor('suspended')
1125 @cachefor('suspended')
1122 def _computesuspendedset(repo):
1126 def _computesuspendedset(repo):
General Comments 0
You need to be logged in to leave comments. Login now