[PATCH 3 of 3] reachableroots: use smartset min

Yuya Nishihara yuya at tcha.org
Thu Aug 27 21:26:41 CDT 2015


On Thu, 27 Aug 2015 12:25:28 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1440198744 25200
> #      Fri Aug 21 16:12:24 2015 -0700
> # Node ID 04cae949223aef6aad5b2bddb2bb34f0973ee590
> # Parent  df0a203aa014a3afe3e4c4aa5fc9033e65fcb8c9
> reachableroots: use smartset min
> 
> smartset min are likely to be optimised, cached or other magical property.
> 
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -133,11 +133,11 @@ def reachableroots(repo, roots, heads, i
>      If includepath is True, return (<roots>::<heads>)."""
>      if not roots:
>          return baseset()
>      # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset
>      # (and if it is not, it should.)
> -    minroot = min(roots)
> +    minroot = roots.min()
>      roots = list(roots)
>      heads = list(heads)

Forgot to remove the XXX comment?


More information about the Mercurial-devel mailing list