##// END OF EJS Templates
revset: speedup matching() by first matching fields that take less time to...
Angel Ezquerra -
r16446:984e0412 default
parent child Browse files
Show More
@@ -950,6 +950,19 b' def matching(repo, subset, x):'
950 950 fields.discard('summary')
951 951
952 952 # We may want to match more than one field
953 # Not all fields take the same amount of time to be matched
954 # Sort the selected fields in order of increasing matching cost
955 fieldorder = ('phase', 'parents', 'user', 'date', 'branch', 'summary',
956 'files', 'description', 'substate',)
957 def fieldkeyfunc(f):
958 try:
959 return fieldorder.index(f)
960 except ValueError:
961 # assume an unknown field is very costly
962 return len(fieldorder)
963 fields = list(fields)
964 fields.sort(key=fieldkeyfunc)
965
953 966 # Each field will be matched with its own "getfield" function
954 967 # which will be added to the getfieldfuncs array of functions
955 968 getfieldfuncs = []
General Comments 0
You need to be logged in to leave comments. Login now