comparison mercurial/revset.py @ 22879:efe5062145c1

baseset: make `_set` a property cache This will remove the need for `baseset.set()`.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 10 Oct 2014 12:30:56 -0700
parents 489d2f3688c9
children 5b635b44af14
comparison
equal deleted inserted replaced
22878:890e874cacb6 22879:efe5062145c1
2311 """ 2311 """
2312 def __init__(self, data=()): 2312 def __init__(self, data=()):
2313 if not isinstance(data, list): 2313 if not isinstance(data, list):
2314 data = list(data) 2314 data = list(data)
2315 self._list = data 2315 self._list = data
2316 self._set = None
2317 self._ascending = None 2316 self._ascending = None
2317
2318 @util.propertycache
2319 def _set(self):
2320 return set(self._list)
2318 2321
2319 @util.propertycache 2322 @util.propertycache
2320 def _asclist(self): 2323 def _asclist(self):
2321 asclist = self._list[:] 2324 asclist = self._list[:]
2322 asclist.sort() 2325 asclist.sort()