##// END OF EJS Templates
spanset: implement `first` and `last` methods
Pierre-Yves David -
r22809:88dad916 default
parent child Browse files
Show More
@@ -2862,6 +2862,24 b' class _spanset(abstractsmartset):'
2862 def isdescending(self):
2862 def isdescending(self):
2863 return self._start >= self._end
2863 return self._start >= self._end
2864
2864
2865 def first(self):
2866 if self._ascending:
2867 it = self.fastasc
2868 else:
2869 it = self.fastdesc
2870 for x in it():
2871 return x
2872 return None
2873
2874 def last(self):
2875 if self._ascending:
2876 it = self.fastdesc
2877 else:
2878 it = self.fastasc
2879 for x in it():
2880 return x
2881 return None
2882
2865 class fullreposet(_spanset):
2883 class fullreposet(_spanset):
2866 """a set containing all revisions in the repo
2884 """a set containing all revisions in the repo
2867
2885
General Comments 0
You need to be logged in to leave comments. Login now