changeset 22713:f5f51872883d

abstractsmartset: default implementation for `ascending` and `descending` These two methods are actually silly aliases for `sort()` and `sort(reverse=True)`. So we get that aliasing at the abstractsmartset level. We will slowly phase out all the custom implementations and eventually remove any mentions of it from the code.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 02 Oct 2014 18:34:18 -0500
parents 093df3b77f27
children a729b91c58df
files mercurial/revset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Sep 17 04:55:55 2014 -0700
+++ b/mercurial/revset.py	Thu Oct 02 18:34:18 2014 -0500
@@ -2226,7 +2226,7 @@
         """Sorts the set in ascending order (in place).
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        self.sort()
 
     def isdescending(self):
         """True if the set will iterate in descending order"""
@@ -2236,7 +2236,7 @@
         """Sorts the set in descending order (in place).
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        self.sort(reverse=True)
 
     def min(self):
         """return the minimum element in the set"""