Mercurial > hg
changeset 11708:ba65d61f3158
revset: add min function
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Fri, 30 Jul 2010 10:07:46 +0900 |
parents | 5fdf08b6b50c |
children | a2d45964f60c |
files | mercurial/help/revsets.txt mercurial/revset.py tests/test-revset tests/test-revset.out |
diffstat | 4 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/help/revsets.txt Thu Jul 29 17:18:17 2010 +0900 +++ b/mercurial/help/revsets.txt Fri Jul 30 10:07:46 2010 +0900 @@ -100,6 +100,9 @@ ``max(set)`` Changeset with highest revision number in set. +``min(set)`` + Changeset with lowest revision number in set. + ``merge()`` Changeset is a merge changeset.
--- a/mercurial/revset.py Thu Jul 29 17:18:17 2010 +0900 +++ b/mercurial/revset.py Fri Jul 30 10:07:46 2010 +0900 @@ -195,6 +195,14 @@ return [m] return [] +def minrev(repo, subset, x): + s = getset(repo, subset, x) + if s: + m = min(s) + if m in subset: + return [m] + return [] + def limit(repo, subset, x): l = getargs(x, 2, 2, _("limit wants two arguments")) try: @@ -466,6 +474,7 @@ "keyword": keyword, "limit": limit, "max": maxrev, + "min": minrev, "merge": merge, "modifies": modifies, "outgoing": outgoing,