Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 19:12:36 -0700] rev 20728
revset: added filter method to _addset
This method is intended to duck-type baseset, so we will still have _addset
as a private class but we will be able return it without wrapping it into an
orderedlazyset or a lazyset.
Lucas Moscovicz <lmoscovicz@fb.com> [Fri, 14 Mar 2014 09:18:14 -0700] rev 20727
revset: added comments to all methods needed to duck-type from baseset
All this methods are required to duck-type for any class that works as a smart
set.
Lucas Moscovicz <lmoscovicz@fb.com> [Fri, 14 Mar 2014 10:10:18 -0700] rev 20726
revset: use more explicit argument names for baseset methods
Use other instead of x and condition instead of l
Lucas Moscovicz <lmoscovicz@fb.com> [Tue, 11 Mar 2014 17:09:23 -0700] rev 20725
revset: added isascending and isdescending methods to smartset classes
This methods state if the class is sorted in an ascending or descending order
We need this to implement methods based on order on smartset classes in order
to be able to create new objects with a given order.
We cannot just rely on a simple boolean since unordered set are neither
ascending nor descending.
Lucas Moscovicz <lmoscovicz@fb.com> [Tue, 11 Mar 2014 17:03:43 -0700] rev 20724
revset: added sort method in addset
We need this method to duck-type generatorset since this class is not going to
be used outside revset.py and we don't need to duck-type baseset.
This sort method will only do something when the addset is not already sorted
or is not sorted in the way we want it to be.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 18:57:30 -0700] rev 20723
revset: added reverse method to addset
This method is needed to duck type generatorset.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 13:29:04 -0700] rev 20722
revset: changed _iterator() method on addset to work with a given order
If the two collections are in ascending order, yield their values in an
ordered way by iterating both at the same time and picking the values to
yield.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 14:51:04 -0700] rev 20721
revset: changed _iterator() in addset to use the generated list when available
Now when all the elements have been generated, the iterator will just use the
generated list instead of going through all the elements again.
Lucas Moscovicz <lmoscovicz@fb.com> [Tue, 11 Mar 2014 16:59:42 -0700] rev 20720
revset: added cached generated list to addset
This way when all the values have been generated the list can be sorted
without having to generate them all again.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 17:15:21 -0700] rev 20719
revset: changed sort method to use native sort implementation of smartsets
When sort is done by revision or reversed revision number it can just call
sort on the set and doesn't have to iterate it all over again.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 17:16:58 -0700] rev 20718
revset: fixed sorting issue with spanset
When a spanset was being sorted it didn't take into account it's current
state (ascending or descending) and it reversed itself everytime the reverse
parameter was True.
This is not yet used but it will be as soon as the sort revset is changed to
directly use the structures sort method.
Lucas Moscovicz <lmoscovicz@fb.com> [Thu, 13 Mar 2014 17:20:03 -0700] rev 20717
tests: added tests to test sort revset
This tests are intended to test sort in many different cases where it could
fail when using the new structures