Commits

ZyX_I  committed 49d7c64

@aurum/log: Added “loglimit” option

  • Participants
  • Parent commits f53b1b6

Comments (0)

Files changed (3)

File doc/aurum.txt

     user        Regex. If present, selects revisions where user matches given 
                 regular expression.
     branch      String. If present, selects revisions with given branch name.
-    limit       Number (1 to inf). Shows at most {limit} revisions, starting 
-                from the tip.
+    [no]limit   Number (1 to inf). Shows at most {limit} revisions, starting 
+                from the tip. Use “nolimit” to disable limit. Overrides 
+                |g:aurum_loglimit|.
     revision    Revision. Shows only specified revision.
     revrange    Two revisions. Shows revisions that are between specified 
                 ones.
             1-9      Waits until you type next non-digit
             "        Waits until you type two characters
 
+loglimit                                                    *g:aurum_loglimit*
+    Natural number or 0. Determines, how many revisions should be shown by 
+    default (0 stands for “all”).
+    Default: 0.
+
 recheight                                                  *g:aurum_recheight*
     VimL |expression| that evaluates to unsigned integer or unsigned integer. 
     Determines height of status window shown in record mode (|aurum-record|).

File plugin/aurum/log.vim

             \                'checker': 'list in [patch renames copies files]'},
             \'closewindow': {'default': 1, 'filter': 'bool'},
             \'procinput':   {'default': 1, 'checker': 'range 0 2'},
+            \'loglimit':    {'default': 0, 'checker': 'range 0 inf'},
         \}
 let s:_messages={
             \  'ebuf': 'Switched to another buffer: exiting',
     let opts=a:opts
     let bvar=get(a:000, 0, {'opts': opts})
     let bvar.getblock=s:F.getblock
-    "▶2 Add `ignorefiles'
+    "▶2 Add “limit”
+    if !has_key(bvar.opts, 'limit')
+        let bvar.opts.limit=s:_f.getoption('loglimit')
+    endif
+    "▶2 Add “ignorefiles”
     let ignorefiles=(has_key(opts, 'ignfiles')?
                 \               (opts.ignfiles):
                 \               (s:_f.getoption('ignorefiles')))
             \ '%(\:%(\d\d?|[*.]))?)?)?)?'
 let s:logfunc['@FWC']=['-onlystrings '.
             \          '['.s:_r.cmdutils.nogetrepoarg.']'.
-            \          '{ *?files    (type "")'.
-            \          '  *?ignfiles in [patch renames copies files mappings] '.
-            \                          '~start'.
-            \          '   ?date     match /\v[<>]?\=?'.s:datereg.'|'.
+            \          '{ *  ?files    (type "")'.
+            \          '  *  ?ignfiles in [patch renames copies files '.
+            \                             'mappings] ~start'.
+            \          '     ?date     match /\v[<>]?\=?'.s:datereg.'|'.
             \                                 s:datereg.'\<\=?\>'.s:datereg.'/'.
-            \          '   ?search   isreg'.
-            \          '   ?user     isreg'.
-            \          '   ?branch   type ""'.
-            \          '   ?limit    range 1 inf'.
-            \          '   ?revision type ""'.
-            \          ' +2?revrange type "" type ""'.
-            \          '   ?style    in _r.template.tlist'.
-            \          '   ?template idof variable'.
-            \          '  !?merges'.
-            \          '  !?patch'.
-            \          '  !?stat'.
-            \          '  !?showfiles'.
-            \          '  !?showrenames'.
-            \          '  !?showcopies'.
-            \          '  !?procinput'.
+            \          '     ?search   isreg'.
+            \          '     ?user     isreg'.
+            \          '     ?branch   type ""'.
+            \          ' ! +1?limit    range 1 inf'.
+            \          '     ?revision type ""'.
+            \          '   +2?revrange type "" type ""'.
+            \          '     ?style    in _r.template.tlist'.
+            \          '     ?template idof variable'.
+            \          ' !   ?merges'.
+            \          ' !   ?patch'.
+            \          ' !   ?stat'.
+            \          ' !   ?showfiles'.
+            \          ' !   ?showrenames'.
+            \          ' !   ?showcopies'.
+            \          ' !   ?procinput'.
             \          s:_r.repo.diffoptsstr.
-            \          '   ?cmd      type ""'.
+            \          '    ?cmd      type ""'.
             \          '}', 'filter']
 call add(s:logcomp, substitute(substitute(
             \substitute(substitute(substitute(substitute(s:logfunc['@FWC'][0],

File test/maps-log.ok

 {{{1 <CR>
 aurum://diff:%ETMPDIR%%-test%-maps-logrepo:504f74154456dbb0e9441326514e42ce66279e62:::
 {{{1 branch <CR>
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:branch,branch:A,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:branch,branch:A,
 {{{1 user <CR>
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:user:%+VA <a@example.com>,crrestrict:user,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:user,user:%+VA <a@example.com>,
 {{{1 date <CR>
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:date:2002-02,crrestrict:date,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:date:2002-02,limit:0,crrestrict:date,
 {{{1 changeset <CR>
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:revision,revision:504f74154456dbb0e9441326514e42ce66279e62,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:revision,revision:504f74154456dbb0e9441326514e42ce66279e62,
 {{{1 gF
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:files:directory%-file,crrestrict:files,showfiles:1,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:files,files:directory%-file,limit:0,showfiles:1,
 {{{1 gF+files
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:files:.hgignore,crrestrict:files,showfiles:1,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:files,files:.hgignore,limit:0,showfiles:1,
 {{{1 gu
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:user:%+VA <a@example.com>,crrestrict:user,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:user,user:%+VA <a@example.com>,
 {{{1 gM
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:date:2002-02,crrestrict:date,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:date:2002-02,limit:0,crrestrict:date,
 {{{1 gb
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:branch,branch:A,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:branch,branch:A,
 {{{1 gr
-aurum://log:%ETMPDIR%%-test%-maps-logrepo:crrestrict:revision,revision:be92227e3e43f4e7402408afe110098d209d2568,
+aurum://log:%ETMPDIR%%-test%-maps-logrepo:limit:0,crrestrict:revision,revision:be92227e3e43f4e7402408afe110098d209d2568,
 {{{1 gD
  1*1: aurum://log:%ETMPDIR%%-test%-maps-logrepo:
  1#2: