Patchwork [1,of,3] reachableroots: sort the smartset in the pure version too

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 27, 2015, 7:25 p.m.
Message ID <c8a380090773ed60d31d.1440703526@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10298/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 27, 2015, 7:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1440456042 25200
#      Mon Aug 24 15:40:42 2015 -0700
# Node ID c8a380090773ed60d31d8f8b4e01bbac797688b0
# Parent  05e7f57c74ac5b556b49870af86f61aa0c54babb
reachableroots: sort the smartset in the pure version too

Changeset be8a4e0800d8 use smarset lazy sorting for the C version. We need to
apply the same to the pure version for consistency. This is fixing the tests
with --pure.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -121,11 +121,13 @@  def reachablerootspure(repo, minroot, ro
         return reachable
     for rev in sorted(seen):
         for parent in seen[rev]:
             if parent in reachable:
                 reached(rev)
-    return baseset(sorted(reachable))
+    reachable = baseset(reachable)
+    reachable.sort()
+    return reachable
 
 def reachableroots(repo, roots, heads, includepath=False):
     """return (heads(::<roots> and ::<heads>))
 
     If includepath is True, return (<roots>::<heads>)."""