diff tests/test-revset.t @ 26638:7afaf2566e25

revset: add optional offset argument to limit() predicate It's common for GUI or web frontend to fetch chunk of revisions per batch size. Previously it was possible only if revisions were sorted by revision number. $ hg log -r 'limit({revspec} & :{last_known}, 101)' So this patch introduces a general way to retrieve chunk of revisions after skipping offset revisions. $ hg log -r 'limit({revspec}, 100, {last_count})' This is a dumb implementation. We can optimize it for baseset and spanset later.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 24 Mar 2015 00:28:28 +0900
parents 832feae7c986
children c60a9c16ae25
line wrap: on
line diff
--- a/tests/test-revset.t	Mon Oct 12 17:19:22 2015 +0900
+++ b/tests/test-revset.t	Tue Mar 24 00:28:28 2015 +0900
@@ -566,6 +566,16 @@
   $ log 'keyword("test a")'
   $ log 'limit(head(), 1)'
   0
+  $ log 'limit(author("re:bob|test"), 3, 5)'
+  5
+  6
+  7
+  $ log 'limit(author("re:bob|test"), offset=6)'
+  6
+  $ log 'limit(author("re:bob|test"), offset=10)'
+  $ log 'limit(all(), 1, -1)'
+  hg: parse error: negative offset
+  [255]
   $ log 'matching(6)'
   6
   $ log 'matching(6:7, "phase parents user date branch summary files description substate")'