Commits

ZyX_I committed 395e46d

@aurum/cmdutils, @aurum: Moved nogetrepoarg from cmdutils to @aurum
@aurum/computils, @aurum: Moved @aurum/computils to @aurum

Comments (0)

Files changed (24)

autoload/aurum/annotate.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('1.0', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('1.0', {'@aurum/cmdutils': '3.0',
             \                 '@aurum/bufvars': '0.0',
             \                    '@aurum/edit': '1.0',
             \                         '@aurum': '1.0',

autoload/aurum/branch.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',})
+            \       '@aurum/cmdutils': '3.0',})
 let s:_messages={
             \ 'bexsts': 'Error while creating branch %s for repository %s: '.
             \           'branch already exists',

autoload/aurum/commit.vim

             \                  '@/options': '0.0',
             \                     '@aurum': '1.0',
             \             '@%aurum/status': '1.0',
-            \            '@aurum/cmdutils': '2.0',
+            \            '@aurum/cmdutils': '3.0',
             \             '@aurum/bufvars': '0.0',
             \                '@aurum/edit': '1.0',})
 let s:_messages={

autoload/aurum/diff.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('0.0', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('0.0', {'@aurum/cmdutils': '3.0',
             \                 '@aurum/bufvars': '0.0',
             \               '@aurum/lineutils': '0.0',
             \                '@%aurum/vimdiff': '1.0',

autoload/aurum/file.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('0.0', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('0.0', {'@aurum/cmdutils': '3.0',
             \                 '@aurum/bufvars': '0.0',
             \               '@aurum/lineutils': '0.0',
             \                '@%aurum/vimdiff': '1.0',

autoload/aurum/grep.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',
+            \       '@aurum/cmdutils': '3.0',
             \           '@aurum/edit': '1.0',
             \             '@/options': '0.0',})
 let s:_messages={

autoload/aurum/hyperlink.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',
+            \       '@aurum/cmdutils': '3.0',
             \             '@/options': '0.0',})
 let s:_messages={
             \'uknurl': 'Failed to process url %s of repository %s',

autoload/aurum/junk.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',})
+            \       '@aurum/cmdutils': '3.0',})
 let s:_messages={
             \'nofiles': 'No files were specified',
         \}

autoload/aurum/log.vim

 "▶1
 scriptencoding utf-8
-execute frawor#Setup('1.1', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('1.1', {'@aurum/cmdutils': '3.0',
             \           '@aurum/log/templates': '0.0',
             \               '@aurum/lineutils': '0.0',
             \                 '@aurum/bufvars': '0.0',

autoload/aurum/move.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',
+            \       '@aurum/cmdutils': '3.0',
             \           '@aurum/edit': '1.0',
             \                  '@/os': '0.0',
             \               '@/table': '0.0',})

autoload/aurum/name.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',})
+            \       '@aurum/cmdutils': '3.0',})
 let s:_messages={
             \ 'nunsup': 'Naming is not supported for repository %s',
             \'ukntype': 'Unknown label type: %s. Supported types: %s',

autoload/aurum/other.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',
+            \       '@aurum/cmdutils': '3.0',
             \                  '@/os': '0.0',})
 function s:cmd.function(bang, action, rev, url, repopath)
     let repo=s:_r.cmdutils.checkedgetrepo(a:repopath)

autoload/aurum/record.vim

             \               '@/mappings': '0.0',
             \                   '@aurum': '1.0',
             \           '@%aurum/commit': '1.0',
-            \          '@aurum/cmdutils': '2.0',
+            \          '@aurum/cmdutils': '3.0',
             \         '@aurum/lineutils': '0.0',
             \              '@aurum/edit': '1.0',
             \           '@aurum/bufvars': '0.0',})

autoload/aurum/status.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('1.1', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('1.1', {'@aurum/cmdutils': '3.0',
             \                    '@aurum/repo': '4.0',
             \                    '@aurum/edit': '1.0',
             \                         '@aurum': '1.0',

autoload/aurum/track.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',})
+            \       '@aurum/cmdutils': '3.0',})
 function s:cmd.function(...)
     let globs=filter(copy(a:000), 'v:val isnot# ":"')
     let hascur=!(a:0 && len(globs)==a:0)

autoload/aurum/update.vim

 scriptencoding utf-8
 execute frawor#Setup('0.0', {'@aurum': '1.0',
-            \       '@aurum/cmdutils': '2.2',})
+            \       '@aurum/cmdutils': '3.0',})
 function s:cmd.function(bang, rev, repopath)
     let repo=s:_r.cmdutils.checkedgetrepo(a:repopath)
     if a:rev is 0

autoload/aurum/vimdiff.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('1.0', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('1.0', {'@aurum/cmdutils': '3.0',
             \                    '@aurum/edit': '1.3',
             \                         '@aurum': '1.0',
             \                     '@/mappings': '0.0',
     0.1: Added full, untracked, onlymodified and files options to |:AuVimDiff|
     0.2: Added _r.vimdiff.full.
     1.0: Renamed g:aurum_usewin option to |g:aurum_vimdiffusewin|.
-@aurum/log:
+@%aurum/log:
     0.1: Added |aurum-style-git| and |aurum-style-gitoneline| log styles, 
          added skipping of $rev if |aurum-repo.hasrevisions| is false, made it 
          separate graph from content using non-breaking spaces.
     2.1: Added getrrf(..., "getsilent") support.
     2.2: Added checkedgetrepo, getaddedermvdfiles, filterfiles and 
          getexsttrckdfiles _r.cmdutils functions.
+    3.0: Removed cmdutils.nogetrepoarg.
 autoload/aurum:
     0.1: Added |aurum#branch()| function.
 @aurum/cache:

ftplugin/aurumlog.vim

 endif
 setlocal noswapfile
 setlocal nomodeline
-execute frawor#Setup('0.1', {'@aurum/cmdutils': '2.0',
+execute frawor#Setup('0.1', {'@aurum/cmdutils': '3.0',
             \                 '@aurum/bufvars': '0.0',
             \                    '@aurum/repo': '4.0',
             \                    '@aurum/edit': '1.0',

ftplugin/aurumstatus.vim

 setlocal nomodeline
 execute frawor#Setup('0.0', {'@aurum/bufvars': '0.0',
             \               '@%aurum/vimdiff': '1.0',
-            \               '@aurum/cmdutils': '2.0',
+            \               '@aurum/cmdutils': '3.0',
             \                   '@aurum/edit': '1.2',
             \                '@%aurum/commit': '1.0',
             \                    '@/mappings': '0.0',
             \                     '@/fwc': '0.3',
             \            '@/autocommands': '0.0',
             \               '@/resources': '0.0',
-            \           '@aurum/cmdutils': '2.0',
-            \          '@aurum/computils': '0.0',
             \               '@aurum/repo': '4.0',
+            \              '@aurum/cache': '1.0',
             \      '@aurum/log/templates': '0.0',})
 "▶1 Messages
 let s:_messages={
             \ '%(\-%(\d\d?|[*.])'.
             \ '%([ _]%(\d\d?|[*.])'.
             \ '%(\:%(\d\d?|[*.]))?)?)?)?'
+let s:patharg='either (path d, match @\v^\w+%(\+\w+)*\V://\v|^\:$@)'
+let s:nogetrepoarg=':":" ('.s:patharg.')'
+unlet s:patharg
+let s:compbranchrevarg='in *F.branchlist'
+let s:comprevarg='in *F.revlist'
+let s:compcmdarg='first (in compcmds, idof cmd)'
 let s:cmds={
             \'Update':    {'opts': {'bang': 1},
             \               'fwc': '[:=(0) '.s:revarg.
-            \                      '['.s:_r.cmdutils.nogetrepoarg.']',
+            \                      '['.s:nogetrepoarg.']',
             \             },
             \'Move':      {'opts': {'bang': 1},
-            \               'fwc': '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \               'fwc': '{  repo '.s:nogetrepoarg.
             \                      ' ?!copy'.
             \                      ' ?!rightrepl'.
             \                      ' ?!leftpattern'.
             \'Track':     {'fwc': '+ '.s:filearg,
             \             },
             \'Hyperlink': {'opts': {'range': '%'},
-            \               'fwc': '{   ?repo '.s:_r.cmdutils.nogetrepoarg.
+            \               'fwc': '{   ?repo '.s:nogetrepoarg.
             \                      '    ?rev   '.s:revarg.
             \                      '    ?file  '.s:filearg.
             \                      ' !+1?line  range 1 inf'.
             \                      '}',
             \             },
             \'Grep':      {'fwc': 'type "" '.
-            \                     '{     repo     '.s:_r.cmdutils.nogetrepoarg.
+            \                     '{     repo     '.s:nogetrepoarg.
             \                     ' ?*+2 revrange   '.s:revarg.' '.s:revarg.
             \                     ' ?*   revision   '.s:revarg.
             \                     ' ?*   files      '.s:filearg.
             \             },
             \'Branch':    {'opts': {'bang': 1},
             \               'fwc': 'type "" '.
-            \                      '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \                      '{  repo '.s:nogetrepoarg.
             \                      '}',
             \             },
             \'Name':      {'opts': {'bang': 1},
             \               'fwc': 'type ""'.
-            \                      '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \                      '{  repo '.s:nogetrepoarg.
             \                      ' ? type   type ""'.
             \                      ' ?!delete'.
             \                      ' ?!local'.
             \               'fwc': 'in ppactions ~ smart '.
             \                      '[:":" '.s:revarg.
             \                      '[:":" '.s:filearg.
-            \                      '['.s:_r.cmdutils.nogetrepoarg.']]]',
+            \                      '['.s:nogetrepoarg.']]]',
             \             },
-            \'Annotate':  { 'fwc': '{  repo  '.s:_r.cmdutils.nogetrepoarg.
+            \'Annotate':  { 'fwc': '{  repo  '.s:nogetrepoarg.
             \                      '  ?file  '.s:filearg.
             \                      '  ?rev   '.s:revarg.
             \                      '}',
             \             },
-            \'Commit':    { 'fwc': '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \'Commit':    { 'fwc': '{  repo '.s:nogetrepoarg.
             \                      ' *?type      (either (in [modified added '.
             \                                                'removed deleted '.
             \                                                'unknown] ~start,'.
             \                      '}'.
             \                      '+ '.s:filearg,
             \             },
-            \'Diff':      { 'fwc': '{  repo     '.s:_r.cmdutils.nogetrepoarg.
+            \'Diff':      { 'fwc': '{  repo     '.s:nogetrepoarg.
             \                      '  ?rev1     '.s:revarg.
             \                      '  ?rev2     '.s:revarg.
             \                      '  ?changes  '.s:revarg.
             \             },
             \'File':      { 'fwc': '[:=(0)   type ""'.
             \                      '[:=(0)   either (match /\L/, path fr)]]'.
-            \                      '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \                      '{  repo '.s:nogetrepoarg.
             \                      ' !?replace'.
             \                      '  ?cmd    '.s:cmdarg.
             \                      '}',
             \              'subs': [['\V:=(0)\s\+either (\[^)]\+)', 'path', ''],
             \                       ['\V:=(0)\s\+type ""',
-            \                         'either (type "" '.s:_r.comp.rev.')', ''],
+            \                         'either (type "" '.s:comprevarg.')', ''],
             \                      ],
             \             },
-            \'Record':    { 'fwc': '{  repo '.s:_r.cmdutils.nogetrepoarg.
+            \'Record':    { 'fwc': '{  repo '.s:nogetrepoarg.
             \                      '  ?message           type ""'.
             \                      '  ?date              type ""'.
             \                      '  ?user              type ""'.
             \                      '} '.
             \                      '+ '.s:filearg,
             \             },
-            \'Status':    { 'fwc': '['.s:_r.cmdutils.nogetrepoarg.']'.
+            \'Status':    { 'fwc': '['.s:nogetrepoarg.']'.
             \                      '{ *?files     '.s:filearg.
             \                      '   ?rev       '.s:revarg.
             \                      '   ?wdrev     '.s:revarg.
             \                      '   ?cmd       '.s:cmdarg.
             \                      '}',
             \             },
-            \'VimDiff':   { 'fwc': '{  repo  '.s:_r.cmdutils.nogetrepoarg.
+            \'VimDiff':   { 'fwc': '{  repo  '.s:nogetrepoarg.
             \                      '  ?file  '.s:filearg.
             \                      ' *?files (match /\W/)'.
             \                      ' !?full'.
             \                      '+ '.s:revarg,
             \              'subs': [['\V(match /\\W/)', '(path)', '']],
             \             },
-            \'Log':       { 'fwc': '['.s:_r.cmdutils.nogetrepoarg.']'.
+            \'Log':       { 'fwc': '['.s:nogetrepoarg.']'.
             \                      '{ *  ?files    '.s:filearg.
             \                      '  *  ?ignfiles in ignfiles ~start'.
             \                      '     ?date     match /\v[<>]?\=?'.s:datereg.'|'.
             \                      '    ?cmd      '.s:cmdarg.
             \                      '}',
             \              'subs': [['\vbranch\s+\Vtype ""',
-            \                                  'branch '.s:_r.comp.branch, '']],
+            \                                'branch '.s:compbranchrevarg, '']],
             \             },
         \}
+unlet s:datereg s:nogetrepoarg s:compbranchrevarg
 "▶1 Related globals
 let s:utypes=['html', 'raw', 'annotate', 'filehist', 'bundle', 'changeset',
             \ 'log', 'clone', 'push']
             \                           'pull': s:pullactions})
 let s:ignfiles=['patch', 'renames', 'copies', 'files', 'diff', 'open']
 call s:_f.postresource('ignfiles', s:ignfiles)
+"▶1 Completion helpers
+let s:compcmds=['new', 'vnew', 'edit',
+            \   'leftabove vnew', 'rightbelow vnew',
+            \   'topleft vnew',   'botright vnew',
+            \   'aboveleft new',  'belowright new',
+            \   'topleft new',    'botright new',]
+call map(s:compcmds, 'escape(v:val, " ")')
+function s:F.getcrepo(...)
+    if a:0
+        return a:1
+    endif
+    return s:_r.cache.get('repo', s:_r.repo.get, [':'], {})
+endfunction
+function s:F.revlist(...)
+    let repo=call(s:F.getcrepo, a:000, {})
+    return       repo.functions.getrepoprop(repo, 'tagslist')+
+                \repo.functions.getrepoprop(repo, 'brancheslist')+
+                \repo.functions.getrepoprop(repo, 'bookmarkslist')
+endfunction
+function s:F.branchlist(...)
+    let repo=call(s:F.getcrepo, a:000, {})
+    return repo.functions.getrepoprop(repo, 'brancheslist')
+endfunction
 "▶1 Commands setup
 let s:plpref='autoload/aurum/'
 let s:d={}
     "▶2 Completion substitutions
     let s:cdesc.subs=get(s:cdesc, 'subs', [])
     if stridx(s:cdesc.fwc, s:revarg)!=-1
-        let s:cdesc.subs+=[['\V'.s:revarg,    s:_r.comp.rev, 'g']]
+        let s:cdesc.subs+=[['\V'.s:revarg,    s:comprevarg, 'g']]
     endif
     if stridx(s:cdesc.fwc, s:filearg)!=-1
-        let s:cdesc.subs+=[['\V'.s:filearg,   '(path)',      'g']]
+        let s:cdesc.subs+=[['\V'.s:filearg,   '(path)',     'g']]
     endif
     if stridx(s:cdesc.fwc, s:cmdarg)!=-1
-        let s:cdesc.subs+=[['\V'.s:cmdarg,    s:_r.comp.cmd, '' ]]
+        let s:cdesc.subs+=[['\V'.s:cmdarg,    s:compcmdarg, '' ]]
     endif
     "▲2
     let s:compfwc='-onlystrings '.s:cdesc.fwc
     unlet s:cmd s:cdesc
 endfor
 unlet s:d
+unlet s:comprevarg s:compcmdarg
 "▶1 aurumcmd feature
 let s:feature={}
 let s:cmddicts={}

plugin/aurum/cache.vim

 if !exists('s:_pluginloaded')
     execute frawor#Setup('1.0', {'@/resources': '0.0',
                 \                  '@/options': '0.0',
-                \            '@aurum/cmdutils': '2.1',}, 0)
+                \            '@aurum/cmdutils': '3.0',}, 0)
     finish
 elseif s:_pluginloaded
     finish

plugin/aurum/cmdutils.vim

 "▶1
 scriptencoding utf-8
 if !exists('s:_pluginloaded')
-    execute frawor#Setup('2.2', {'@/resources': '0.0',
+    execute frawor#Setup('3.0', {'@/resources': '0.0',
                 \                       '@/os': '0.0',
                 \                '@aurum/repo': '4.0',
                 \                '@aurum/edit': '1.0',
     call FraworLoad(s:_frawor.id)
     finish
 endif
-let s:patharg='either (path d, match @\v^\w+%(\+\w+)*\V://\v|^\:$@)'
-let s:nogetrepoarg=':":" ('.s:patharg.')'
 let s:_messages={
             \  'nrepo': 'Failed to find a repository',
             \'noafile': 'Failed to deduce which file to annotate',
             \                'getexsttrckdfiles': s:F.getexsttrckdfiles,
             \               'getaddedermvdfiles': s:F.getaddedermvdfiles,
             \                      'filterfiles': s:F.filterfiles,
-            \                     'nogetrepoarg': s:nogetrepoarg,
             \})
 "▶1
 call frawor#Lockvar(s:, '_pluginloaded,_r')

plugin/aurum/computils.vim

-"▶1
-scriptencoding utf-8
-if !exists('s:_pluginloaded')
-    execute frawor#Setup('0.0', {'@/resources': '0.0',
-                \                '@aurum/repo': '4.0',
-                \               '@aurum/cache': '1.0',}, 0)
-    finish
-elseif s:_pluginloaded
-    finish
-elseif !exists('s:_loading')
-    call FraworLoad(s:_frawor.id)
-    finish
-endif
-"▶1 Some completion-related globals
-let s:cmds=['new', 'vnew', 'edit',
-            \'leftabove vnew', 'rightbelow vnew', 'topleft vnew', 'botright vnew',
-            \'aboveleft new',  'belowright new',  'topleft new',  'botright new',
-            \]
-call map(s:cmds, 'escape(v:val, " ")')
-"▶1 getcrepo :: [ repo] → repo
-function s:F.getcrepo(...)
-    if a:0
-        return a:1
-    endif
-    return s:_r.cache.get('repo', s:_r.repo.get, [':'], {})
-endfunction
-"▶1 getrevlist :: [ repo] → [String]
-function s:F.getrevlist(...)
-    let repo=call(s:F.getcrepo, a:000, {})
-    return       repo.functions.getrepoprop(repo, 'tagslist')+
-                \repo.functions.getrepoprop(repo, 'brancheslist')+
-                \repo.functions.getrepoprop(repo, 'bookmarkslist')
-endfunction
-"▶1 getbranchlist :: [ repo] → [String]
-function s:F.getbranchlist(...)
-    let repo=call(s:F.getcrepo, a:000, {})
-    return repo.functions.getrepoprop(repo, 'brancheslist')
-endfunction
-"▶1 Post comp resource
-call s:_f.postresource('comp', {'rev': 'in *_r.comp.revlist',
-            \                   'cmd': 'first (in _r.comp.cmdslst, idof cmd)',
-            \                   'branch': 'in *_r.comp.branchlist',
-            \                   'revlist': s:F.getrevlist,
-            \                   'branchlist': s:F.getbranchlist,
-            \                   'cmdslst': s:cmds,
-            \})
-"▶1
-call frawor#Lockvar(s:, '_pluginloaded,_r')
-" vim: ft=vim ts=4 sts=4 et fmr=▶,▲