# HG changeset patch # User Pierre-Yves David # Date 1351003769 -7200 # Node ID 89c8550019d09f14374ce6e54ccde61e4aa4f041 # Parent 8152fedbac65de224b9fb9eed989599769cd6778 mercurial: replace all `newerversion` call by `successorsset` call diff -r 8152fedbac65 -r 89c8550019d0 hgext/evolve.py --- a/hgext/evolve.py Tue Oct 23 16:36:29 2012 +0200 +++ b/hgext/evolve.py Tue Oct 23 16:49:29 2012 +0200 @@ -933,28 +933,6 @@ -def newerversion(repo, obs): - """Return the newer version of an obsolete changeset""" - toproceed = set([(obs,)]) - # XXX known optimization available - newer = set() - objectrels = repo.obsstore.precursors - while toproceed: - current = toproceed.pop() - assert len(current) <= 1, 'splitting not handled yet. %r' % current - current = [n for n in current if n != nullid] - if current: - n, = current - if n in objectrels: - markers = objectrels[n] - for mark in markers: - toproceed.add(tuple(mark[1])) - else: - newer.add(tuple(current)) - else: - newer.add(()) - return sorted(newer) - ##################################################################### ### Extending revset and template ### @@ -1568,13 +1546,13 @@ if not obs.obsolete(): obs = orig.parents()[1] assert obs.obsolete() - newer = newerversion(repo, obs.node()) + newer = successorssets(repo, obs.node()) # search of a parent which is not killed - while newer == [()]: + while not newer or newer == [()]: ui.debug("stabilize target %s is plain dead," " trying to stabilize on its parent") obs = obs.parents()[0] - newer = newerversion(repo, obs.node()) + newer = successorssets(repo, obs.node()) if len(newer) > 1: ui.write_err(_("conflict rewriting. can't choose destination\n")) return 2 diff -r 8152fedbac65 -r 89c8550019d0 hgext/qsync.py --- a/hgext/qsync.py Tue Oct 23 16:36:29 2012 +0200 +++ b/hgext/qsync.py Tue Oct 23 16:49:29 2012 +0200 @@ -85,7 +85,7 @@ except IOError: oldnode = oldfiles[patch_name] evolve = extensions.find('evolve') - newnodes = evolve.newerversion(repo, oldnode) + newnodes = evolve.successorssets(repo, oldnode) if newnodes: newnodes = [n for n in newnodes if n and n[0] in repo] # remove killing if not newnodes: @@ -174,7 +174,7 @@ usedold.add(oldhex) oldname = str(oldname) oldnode = bin(oldhex) - newnodes = evolve.newerversion(repo, oldnode) + newnodes = evolve.successorssets(repo, oldnode) if newnodes: newnodes = [n for n in newnodes if n and n[0] in repo] # remove killing if len(newnodes) > 1: