##// END OF EJS Templates
revset: add inspection data to limit() and last() functions...
Yuya Nishihara -
r28426:3d39ac06 default
parent child Browse files
Show More
@@ -1288,7 +1288,8 b' def limit(repo, subset, x):'
1288 break
1288 break
1289 elif y in subset:
1289 elif y in subset:
1290 result.append(y)
1290 result.append(y)
1291 return baseset(result)
1291 return baseset(result, datarepr=('<limit n=%d, offset=%d, %r, %r>',
1292 lim, ofs, subset, os))
1292
1293
1293 @predicate('last(set, [n])', safe=True)
1294 @predicate('last(set, [n])', safe=True)
1294 def last(repo, subset, x):
1295 def last(repo, subset, x):
@@ -1314,7 +1315,7 b' def last(repo, subset, x):'
1314 break
1315 break
1315 elif y in subset:
1316 elif y in subset:
1316 result.append(y)
1317 result.append(y)
1317 return baseset(result)
1318 return baseset(result, datarepr=('<last n=%d, %r, %r>', lim, subset, os))
1318
1319
1319 @predicate('max(set)', safe=True)
1320 @predicate('max(set)', safe=True)
1320 def maxrev(repo, subset, x):
1321 def maxrev(repo, subset, x):
@@ -1984,11 +1984,48 b' issue4553: check that revset aliases ove'
1984
1984
1985 issue2549 - correct optimizations
1985 issue2549 - correct optimizations
1986
1986
1987 $ log 'limit(1 or 2 or 3, 2) and not 2'
1987 $ try 'limit(1 or 2 or 3, 2) and not 2'
1988 (and
1989 (func
1990 ('symbol', 'limit')
1991 (list
1992 (or
1993 ('symbol', '1')
1994 ('symbol', '2')
1995 ('symbol', '3'))
1996 ('symbol', '2')))
1997 (not
1998 ('symbol', '2')))
1999 * set:
2000 <filteredset
2001 <baseset
2002 <limit n=2, offset=0,
2003 <fullreposet+ 0:9>,
2004 <baseset [1, 2, 3]>>>,
2005 <not
2006 <baseset [2]>>>
1988 1
2007 1
1989 $ log 'max(1 or 2) and not 2'
2008 $ log 'max(1 or 2) and not 2'
1990 $ log 'min(1 or 2) and not 1'
2009 $ log 'min(1 or 2) and not 1'
1991 $ log 'last(1 or 2, 1) and not 2'
2010 $ try 'last(1 or 2, 1) and not 2'
2011 (and
2012 (func
2013 ('symbol', 'last')
2014 (list
2015 (or
2016 ('symbol', '1')
2017 ('symbol', '2'))
2018 ('symbol', '1')))
2019 (not
2020 ('symbol', '2')))
2021 * set:
2022 <filteredset
2023 <baseset
2024 <last n=1,
2025 <fullreposet+ 0:9>,
2026 <baseset [2, 1]>>>,
2027 <not
2028 <baseset [2]>>>
1992
2029
1993 issue4289 - ordering of built-ins
2030 issue4289 - ordering of built-ins
1994 $ hg log -M -q -r 3:2
2031 $ hg log -M -q -r 3:2
General Comments 0
You need to be logged in to leave comments. Login now