# HG changeset patch # User Pierre-Yves David # Date 1345482740 -7200 # Node ID a2dfe82f27a08c3b65fcb675c027c96a7456b419 # Parent abeb17a9e313baea490006929f1903863ed0b1d5 obsolete: use flag to detect that a obsolescence marker fix a latecomer Otherwise latecomer fix will be latecomer too. diff -r abeb17a9e313 -r a2dfe82f27a0 hgext/evolve.py --- a/hgext/evolve.py Tue Aug 21 10:10:44 2012 +0200 +++ b/hgext/evolve.py Mon Aug 20 19:12:20 2012 +0200 @@ -423,7 +423,8 @@ newid = prec.node() else: phases.retractboundary(repo, latecomer.phase(), [newid]) - obsolete.createmarkers(repo, [(tmpctx, (repo[newid],))]) + obsolete.createmarkers(repo, [(tmpctx, (repo[newid],))], + flag=obsolete.latediff) bmupdate(newid) tr.close() repo.ui.status(_('commited as %s\n') % node.short(newid)) 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! diff -r abeb17a9e313 -r a2dfe82f27a0 tests/test-evolve.t --- a/tests/test-evolve.t Tue Aug 21 10:10:44 2012 +0200 +++ b/tests/test-evolve.t Mon Aug 20 19:12:20 2012 +0200 @@ -320,6 +320,7 @@ @@ -3,1 +3,1 @@ -Zwei +deux + $ hg log -r 'latecomer()' # no more latecomer $ cd ..