revset: make matching() preserve input revision order

This commit is contained in:
Patrick Mezard 2012-05-09 18:45:14 +02:00
parent 33aa2b5c45
commit 1ecfe35e64
2 changed files with 7 additions and 5 deletions

View File

@ -996,7 +996,7 @@ def matching(repo, subset, x):
# is only one field to match)
getinfo = lambda r: [f(r) for f in getfieldfuncs]
matches = []
matches = set()
for rev in revs:
target = getinfo(rev)
for r in subset:
@ -1006,10 +1006,8 @@ def matching(repo, subset, x):
match = False
break
if match:
matches.append(r)
if len(revs) > 1:
matches = sorted(set(matches))
return matches
matches.add(r)
return [r for r in subset if r in matches]
def reverse(repo, subset, x):
"""``reverse(set)``

View File

@ -410,6 +410,10 @@ quoting needed
0
$ log '4::8 - 8'
4
$ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
2
3
1
issue2437