diff --git a/lnt/server/ui/util.py b/lnt/server/ui/util.py --- a/lnt/server/ui/util.py +++ b/lnt/server/ui/util.py @@ -262,13 +262,15 @@ that is ordered and sortable. "1" -> (1) "1.2.3" -> (1,2,3) + "1a2,3-45:b6;" -> (1,2,3,45,6) + "abc" -> (hash("abc")) :param dotted: the string revision to convert :param cache: a dict to use as a cache or None for no cache. because this is called many times, it is a nice performance increase to cache these conversions. :return: a tuple with the numeric bits of this revision as ints. - + return a hash in case of miss formatted version to avoid wrong equals. """ if cache is not None: val = cache.get(dotted) @@ -276,11 +278,11 @@ return val else: dotted_parsed = integral_rex.findall(dotted) - val = tuple([int(d) for d in dotted_parsed]) + val = tuple([int(d) for d in dotted_parsed] or [hash(dotted)]) cache[dotted] = val return val dotted_parsed = integral_rex.findall(dotted) - val = tuple([int(d) for d in dotted_parsed]) + val = tuple([int(d) for d in dotted_parsed] or [hash(dotted)]) return val