Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 24116:8b90a60181d1
revset: drop factory that promotes spanset to fullreposet
All callers use fullreposet where appropriate.
Backed out changeset fbae659543cf
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 08 Jan 2015 23:43:15 +0900 |
parents | ff24af40728b |
children | bb11081562d7 |
comparison
equal
deleted
inserted
replaced
24115:ff24af40728b | 24116:8b90a60181d1 |
---|---|
3202 return self.first() | 3202 return self.first() |
3203 if self: | 3203 if self: |
3204 return it().next() | 3204 return it().next() |
3205 return None | 3205 return None |
3206 | 3206 |
3207 def spanset(repo, start=None, end=None): | 3207 class spanset(abstractsmartset): |
3208 """factory function to dispatch between fullreposet and actual spanset | |
3209 | |
3210 Feel free to update all spanset call sites and kill this function at some | |
3211 point. | |
3212 """ | |
3213 if start is None and end is None: | |
3214 return fullreposet(repo) | |
3215 return _spanset(repo, start, end) | |
3216 | |
3217 | |
3218 class _spanset(abstractsmartset): | |
3219 """Duck type for baseset class which represents a range of revisions and | 3208 """Duck type for baseset class which represents a range of revisions and |
3220 can work lazily and without having all the range in memory | 3209 can work lazily and without having all the range in memory |
3221 | 3210 |
3222 Note that spanset(x, y) behave almost like xrange(x, y) except for two | 3211 Note that spanset(x, y) behave almost like xrange(x, y) except for two |
3223 notable points: | 3212 notable points: |
3317 it = self.fastasc | 3306 it = self.fastasc |
3318 for x in it(): | 3307 for x in it(): |
3319 return x | 3308 return x |
3320 return None | 3309 return None |
3321 | 3310 |
3322 class fullreposet(_spanset): | 3311 class fullreposet(spanset): |
3323 """a set containing all revisions in the repo | 3312 """a set containing all revisions in the repo |
3324 | 3313 |
3325 This class exists to host special optimization. | 3314 This class exists to host special optimization. |
3326 """ | 3315 """ |
3327 | 3316 |