Show More
@@ -2944,6 +2944,20 b' class filteredset(abstractsmartset):' | |||||
2944 | def __repr__(self): |
|
2944 | def __repr__(self): | |
2945 | return '<%s %r>' % (type(self).__name__, self._subset) |
|
2945 | return '<%s %r>' % (type(self).__name__, self._subset) | |
2946 |
|
2946 | |||
|
2947 | # this function will be removed, or merged to addset or orset, when | |||
|
2948 | # - scmutil.revrange() can be rewritten to not combine calculated smartsets | |||
|
2949 | # - or addset can handle more than two sets without balanced tree | |||
|
2950 | def _combinesets(subsets): | |||
|
2951 | """Create balanced tree of addsets representing union of given sets""" | |||
|
2952 | if not subsets: | |||
|
2953 | return baseset() | |||
|
2954 | if len(subsets) == 1: | |||
|
2955 | return subsets[0] | |||
|
2956 | p = len(subsets) // 2 | |||
|
2957 | xs = _combinesets(subsets[:p]) | |||
|
2958 | ys = _combinesets(subsets[p:]) | |||
|
2959 | return addset(xs, ys) | |||
|
2960 | ||||
2947 | def _iterordered(ascending, iter1, iter2): |
|
2961 | def _iterordered(ascending, iter1, iter2): | |
2948 | """produce an ordered iteration from two iterators with the same order |
|
2962 | """produce an ordered iteration from two iterators with the same order | |
2949 |
|
2963 |
General Comments 0
You need to be logged in to leave comments.
Login now