##// END OF EJS Templates
revset: fast implementation for fullreposet.__and__...
Pierre-Yves David -
r22510:911f5a65 default
parent child Browse files
Show More
@@ -2871,5 +2871,36 b' class fullreposet(_spanset):'
2871 def __init__(self, repo):
2871 def __init__(self, repo):
2872 super(fullreposet, self).__init__(repo)
2872 super(fullreposet, self).__init__(repo)
2873
2873
2874 def __and__(self, other):
2875 """fullrepo & other -> other
2876
2877 As self contains the whole repo, all of the other set should also be in
2878 self. Therefor `self & other = other`.
2879
2880 This boldly assumes the other contains valid revs only.
2881 """
2882 # other not a smartset, make is so
2883 if not util.safehasattr(other, 'set'):
2884 # filter out hidden revision
2885 # (this boldly assumes all smartset are pure)
2886 #
2887 # `other` was used with "&", let's assume this is a set like
2888 # object.
2889 other = baseset(other - self._hiddenrevs)
2890 elif not util.safehasattr(other, 'ascending'):
2891 # "other" is _generatorset not a real smart set
2892 # we fallback to the old way (sad kitten)
2893 return super(fullreposet, self).__and__(other)
2894
2895 # preserve order:
2896 #
2897 # this is probably useless and harmful in multiple cases but matches
2898 # the current behavior.
2899 if self.isascending():
2900 other.ascending()
2901 else:
2902 other.descending()
2903 return other
2904
2874 # tell hggettext to extract docstrings from these functions:
2905 # tell hggettext to extract docstrings from these functions:
2875 i18nfunctions = symbols.values()
2906 i18nfunctions = symbols.values()
General Comments 0
You need to be logged in to leave comments. Login now