[PATCH 3 of 3] reachableroots: use smartset min

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Aug 27 14:25:28 CDT 2015


# 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)
     try:
         return repo.changelog.reachableroots(minroot, heads, roots, includepath)
     except AttributeError:


More information about the Mercurial-devel mailing list