# HG changeset patch # User Pierre-Yves David # Date 2012-01-20 18:23:53 # Node ID b345f851d05621575052a8352fc50724616f59e8 # Parent 52dc2b33d0bea1e249e0fa2fa70fae60d41d87ff phase: extracts heads computation logics from analyzeremotephases diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -285,8 +285,15 @@ def analyzeremotephases(repo, subset, ro repo.ui.warn(_('ignoring unexpected root from remote: %i %s\n') % (phase, nhex)) # compute heads - revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))', - subset, draftroots, draftroots, subset) - publicheads = [c.node() for c in revset] + publicheads = newheads(repo, subset, draftroots) return publicheads, draftroots +def newheads(repo, heads, roots): + """compute new head of a subset minus another + + * `heads`: define the first subset + * `rroots`: define the second we substract to the first""" + revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))', + heads, roots, roots, heads) + return [c.node() for c in revset] +