mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
revset: make matching() preserve input revision order
This commit is contained in:
parent
33aa2b5c45
commit
1ecfe35e64
@ -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)``
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user