diff -r abeb17a9e313 -r a2dfe82f27a0 hgext/obsolete.py --- a/hgext/obsolete.py Tue Aug 21 10:10:44 2012 +0200 +++ b/hgext/obsolete.py Mon Aug 20 19:12:20 2012 +0200 @@ -487,12 +487,15 @@ # - push warning ### Cache computation +latediff = 1 # flag to prevent taking late comer fix into account @cachefor('latecomer') def _computelatecomerset(repo): """the set of rev trying to obsolete public revision""" - query = 'allsuccessors(public()) - obsolete() - public()' - return set(repo.revs(query)) + candidates = _allsuccessors(repo, repo.revs('public()'), + haltonflags=latediff) + query = '%ld - obsolete() - public()' + return set(repo.revs(query, candidates)) @cachefor('conflicting') def _computeconflictingset(repo): @@ -709,14 +712,19 @@ cs.add(sr) return cs -def _allsuccessors(repo, s): # XXX we need a better naming - """transitive successors of a subset""" +def _allsuccessors(repo, s, haltonflags=0): # XXX we need a better naming + """transitive successors of a subset + + haltonflags allows to provide flags which prevent the evaluation of a + marker. """ toproceed = [repo[r].node() for r in s] seen = set() allobjects = repo.obsstore.precursors while toproceed: nc = toproceed.pop() for mark in allobjects.get(nc, ()): + if mark[2] & haltonflags: + continue for sub in mark[1]: if sub == nullid: continue # should not be here!