diff -r 88dad916c008 -r 7f97cb12782f mercurial/revset.py --- a/mercurial/revset.py Mon Oct 06 11:54:53 2014 -0700 +++ b/mercurial/revset.py Mon Oct 06 11:57:59 2014 -0700 @@ -2618,6 +2618,16 @@ if self._ascending is not None: self._ascending = not self._ascending + def first(self): + if self: + return self._list.first() + return None + + def last(self): + if self: + return self._list.last() + return None + class generatorset(abstractsmartset): """Wrap a generator for lazy iteration