Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revset.py @ 18071:bea754715961
obsolete: add revset and test for divergent changesets
This changesets add a new `divergent()` revset similar to `unstable()` and
`bumped()` one. Introducting this revset allows actuall test of the divergent
detection.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 12 Dec 2012 03:12:55 +0100 |
parents | 34a1a639d835 |
children | a6483f827512 |
line wrap: on
line diff
--- a/mercurial/revset.py Wed Dec 12 03:19:30 2012 +0100 +++ b/mercurial/revset.py Wed Dec 12 03:12:55 2012 +0100 @@ -646,6 +646,15 @@ return [r for r in subset if r in dests] +def divergent(repo, subset, x): + """``divergent()`` + Final successors of changesets with an alternative set of final successors. + """ + # i18n: "divergent" is a keyword + getargs(x, 0, 0, _("divergent takes no arguments")) + divergent = obsmod.getrevs(repo, 'divergent') + return [r for r in subset if r in divergent] + def draft(repo, subset, x): """``draft()`` Changeset in draft phase.""" @@ -1541,6 +1550,7 @@ "descendants": descendants, "_firstdescendants": _firstdescendants, "destination": destination, + "divergent": divergent, "draft": draft, "extinct": extinct, "extra": extra,