ZyX_I avatar ZyX_I committed c3779e7

@aurum/repo: Moved _r.repo.diffoptsstr+diffoptslst to @aurum
Moved _r.repo.update to @%aurum/cmdutils

Comments (0)

Files changed (16)

autoload/aurum.vim

 "▶1 
-execute frawor#Setup('0.1', {'@aurum/repo': '4.0',
+execute frawor#Setup('0.1', {'@aurum/repo': '5.0',
             \               '@aurum/cache': '1.0',
             \           '@%aurum/cmdutils': '3.0',})
 "▶1 getcrf

autoload/aurum/cmdutils.vim

 "▶1
 scriptencoding utf-8
-execute frawor#Setup('3.0', {'@/resources': '0.0',
+execute frawor#Setup('3.1', {'@/resources': '0.0',
             \                       '@/os': '0.0',
-            \                '@aurum/repo': '4.0',
+            \                '@aurum/repo': '5.0',
             \                '@aurum/edit': '1.0',
             \             '@aurum/bufvars': '0.0',})
 let s:_messages={
     endwhile
     return r
 endfunction
+"▶1 update
+" TODO Investigate whether this function should be moved to cmdutils, or to 
+" maputils which is probably to be created
+function s:F.update(repo, rev, count)
+    let rev=a:rev
+    if a:count>1
+        let rev=a:repo.functions.getnthparent(a:repo, rev, a:count-1).hex
+    endif
+    return a:repo.functions.update(a:repo, rev, 0)
+endfunction
 "▶1 Post cmdutils resource
 call s:_f.postresource('cmdutils', {'globescape': s:F.globescape,
             \                           'getrrf': s:F.getrrf,
             \                'getexsttrckdfiles': s:F.getexsttrckdfiles,
             \               'getaddedermvdfiles': s:F.getaddedermvdfiles,
             \                      'filterfiles': s:F.filterfiles,
+            \                           'update': s:F.update,
             \})
 "▶1
 call frawor#Lockvar(s:, '_pluginloaded,_r')

autoload/aurum/diff.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('0.0', {'@%aurum/cmdutils': '3.0',
+execute frawor#Setup('0.0', {'@%aurum/cmdutils': '3.1',
             \                  '@aurum/bufvars': '0.0',
             \                '@aurum/lineutils': '0.0',
             \                 '@%aurum/vimdiff': '1.0',
             \                     '@aurum/edit': '1.2',
             \                          '@aurum': '1.0',
-            \                     '@aurum/repo': '4.0',
             \                      '@/mappings': '0.0',
             \                            '@/os': '0.0',})
 let s:_messages={
         return
     endif
     "▲2
-    let opts=filter(copy(a:opts), 'index(s:_r.repo.diffoptslst, v:key)!=-1')
+    let opts=filter(copy(a:opts), 'index(s:_r.diffopts, v:key)!=-1')
     call s:_r.run(get(a:opts, 'cmd', 'silent edit'), 'diff', repo, rev1, rev2,
                 \ filelist, opts)
     if !has_key(a:opts, 'cmd')
         let cmd.=s:_r.cmdutils.closebuf(bvar)
     elseif a:action is# 'update'
         let rev=(empty(bvar.rev1)?(bvar.rev2):(bvar.rev1))
-        call s:_r.repo.update(bvar.repo, rev, v:count)
+        call s:_r.cmdutils.update(bvar.repo, rev, v:count)
         return ''
     elseif a:action is# 'previous' || a:action is# 'next'
         let c=((a:action is# 'previous')?(v:count1):(-v:count1))
 "▶1 aurum://diff
 let s:diff= {'arguments': 2,
             \ 'listargs': 1,
-            \  'options': {'num': s:_r.repo.diffoptslst},
+            \  'options': {'num': s:_r.diffopts},
             \ 'filetype': 'diff',
             \   'mgroup': 'AuDiff',
             \}

autoload/aurum/file.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('0.0', {'@%aurum/cmdutils': '3.0',
+execute frawor#Setup('0.0', {'@%aurum/cmdutils': '3.1',
             \                  '@aurum/bufvars': '0.0',
             \                '@aurum/lineutils': '0.0',
             \                 '@%aurum/vimdiff': '1.0',
-            \                     '@aurum/repo': '4.0',
             \                     '@aurum/edit': '1.2',
             \                          '@aurum': '1.0',
             \                            '@/os': '0.0',
     if a:action is# 'exit'
         let cmd.=s:_r.cmdutils.closebuf(bvar)
     elseif a:action is# 'update'
-        call s:_r.repo.update(bvar.repo, bvar.rev, v:count)
+        call s:_r.cmdutils.update(bvar.repo, bvar.rev, v:count)
         return ''
     elseif a:action is# 'previous' || a:action is# 'next'
         let c=((a:action is# 'previous')?(v:count1):(-v:count1))

autoload/aurum/log.vim

             \                '@aurum/lineutils': '0.0',
             \                  '@aurum/bufvars': '0.0',
             \                     '@aurum/edit': '1.1',
-            \                     '@aurum/repo': '4.0',
             \                          '@aurum': '1.0',
             \                       '@/options': '0.0',
             \                         '@/table': '0.1',})
             \             'bool': ['merges', 'patch', 'stat', 'showfiles',
             \                      'showrenames', 'showcopies', 'procinput',
             \                      'autoaddlog'],
-            \              'num': ['limit']+s:_r.repo.diffoptslst,
+            \              'num': ['limit']+s:_r.diffopts,
             \              'str': ['date', 'search', 'user', 'branch',
             \                      'revision', 'style', 'template',
             \                      'crrestrict'],

autoload/aurum/status.vim

 "▶1 
 scriptencoding utf-8
 execute frawor#Setup('1.1', {'@%aurum/cmdutils': '3.0',
-            \                     '@aurum/repo': '4.0',
             \                     '@aurum/edit': '1.0',
             \                          '@aurum': '1.0',
             \                       '@/options': '0.0',
 ==============================================================================
 11. Changelog                                                *aurum-changelog*
 
-@aurum/repo (reflects all drivers’ API changes):
+@%aurum/repo (reflects all drivers’ API changes):
     1.0: Instead of depending on drivers, make drivers depend on @aurum/repo
     1.1: Added repo.branch and repo.label
     1.2: Added setlines function, default implementations of |aurum-rf-copy|, 
          |aurum-repo.iterfuncs|, removed repo.cslist, added 
          |aurum-repo.mutable|.
     4.1: Added csnum key to value returned by |aurum-repo.iterfuncs|.func().
+    5.0: Removed _r.repo.update, .diffoptslst and .diffoptsstr.
 @aurum:
     0.1: Added |:AuBranch| and |:AuName|.
     0.2: Added |:AuOther|.
          “line 0” for referencing current line, it is now “.AuH”. Also made it 
          accept “noline”.
     0.4: Added |:AuHyperlink| lines.
-    1.0: Splitted into a number of plugins, added aurumcmd feature.
+    1.0: Splitted into a number of plugins, added aurumcmd feature and 
+         a number of resources.
 @aurum/edit:
     1.0: Removed setlines function (moved it to @aurum/repo).
     1.1: Added “requiresbvar” _f.newcommand option.
     2.1: Added getrrf(..., "getsilent") support.
     2.2: Added checkedgetrepo, getaddedermvdfiles, filterfiles and 
          getexsttrckdfiles _r.cmdutils functions.
-    3.0: Removed cmdutils.nogetrepoarg.
+    3.0: Removed _r.cmdutils.nogetrepoarg.
+    3.1: Added _r.cmdutils.update (moved from @aurum/repo).
 autoload/aurum:
     0.1: Added |aurum#branch()| function.
 @aurum/cache:

ftplugin/aurumannotate.vim

 endif
 setlocal noswapfile
 setlocal nomodeline
-execute frawor#Setup('0.0', {'@aurum/repo': '4.0',
-            \             '@aurum/bufvars': '0.0',
-            \            '@%aurum/vimdiff': '1.0',
-            \           '@%aurum/annotate': '1.0',
-            \                '@aurum/edit': '1.2',
-            \                 '@/mappings': '0.0',
-            \                       '@/os': '0.0',})
+execute frawor#Setup('0.0', {'@aurum/bufvars': '0.0',
+            \               '@%aurum/vimdiff': '1.0',
+            \              '@%aurum/annotate': '1.0',
+            \              '@%aurum/cmdutils': '3.1',
+            \                   '@aurum/edit': '1.2',
+            \                    '@/mappings': '0.0',
+            \                          '@/os': '0.0',})
 let s:_messages={
             \  'nofile': 'File %s was added in revision %s',
             \ 'norfile': 'File %s is not present in the working directory '.
         endif
     "▶2 `update' action
     elseif a:action is# 'update'
-        call s:_r.repo.update(bvar.repo, hex, v:count)
+        call s:_r.cmdutils.update(bvar.repo, hex, v:count)
     "▶2 `previous' and `next' actions
     elseif a:action is# 'previous' || a:action is# 'next'
         let c=((a:action is# 'previous')?(v:count1):(-v:count1))

ftplugin/aurumcommit.vim

 endif
 setlocal noswapfile
 setlocal nomodeline
-execute frawor#Setup('0.0', {'@aurum/bufvars': '0.0',
-            \                    '@/mappings': '0.0',
-            \                '@%aurum/commit': '1.0',})
+execute frawor#Setup('0.0', {'@/mappings': '0.0',
+            \            '@aurum/bufvars': '0.0',
+            \            '@%aurum/commit': '1.0',})
 "▶1 com.runcommap
 function s:F.runcommap(action)
     let buf=bufnr('%')

ftplugin/aurumlog.vim

 endif
 setlocal noswapfile
 setlocal nomodeline
-execute frawor#Setup('0.1', {'@%aurum/cmdutils': '3.0',
+execute frawor#Setup('0.1', {'@%aurum/cmdutils': '3.1',
             \                  '@aurum/bufvars': '0.0',
-            \                     '@aurum/repo': '4.0',
             \                     '@aurum/edit': '1.0',
+            \                 '@%aurum/vimdiff': '1.0',
             \                            '@/os': '0.0',
-            \                 '@%aurum/vimdiff': '1.0',
             \                      '@/mappings': '0.0',})
 let s:_messages={
             \    'noprev': 'Can’t find any revision before %s',
 function s:F.update()
     let bvar=s:_r.bufvars[bufnr('%')]
     let hex=bvar.getblock(bvar)[2]
-    call s:_r.repo.update(bvar.repo, hex, v:count)
+    call s:_r.cmdutils.update(bvar.repo, hex, v:count)
     return "\<C-\>\<C-n>:silent edit\n"
 endfunction
 "▶1 AuLog mapping group
             \                     '@/fwc': '0.3',
             \            '@/autocommands': '0.0',
             \               '@/resources': '0.0',
-            \               '@aurum/repo': '4.0',
             \              '@aurum/cache': '1.0',
             \      '@aurum/log/templates': '0.0',})
 "▶1 Messages
 let s:compbranchrevarg='in *F.branchlist'
 let s:comprevarg='in *F.revlist'
 let s:compcmdarg='first (in compcmds, idof cmd)'
+" XXX Some code relies on the fact that all options from s:diffoptslst are
+"     numeric
+let s:diffoptslst=['git', 'reverse', 'ignorews', 'iwsamount', 'iblanks',
+            \      'numlines', 'showfunc', 'alltext', 'dates']
+let s:diffoptsstr=join(map(copy(s:diffoptslst),
+            \          'v:val is# "numlines" ? '.
+            \               '" ?".v:val." range 0 inf" : '.
+            \               '"!?".v:val'))
 let s:cmds={
             \'Update':    {'opts': {'bang': 1},
             \               'fwc': '[:=(0) '.s:revarg.
             \                      '  ?rev1     '.s:revarg.
             \                      '  ?rev2     '.s:revarg.
             \                      '  ?changes  '.s:revarg.
-            \                      s:_r.repo.diffoptsstr.
+            \                      s:diffoptsstr.
             \                      '  ?cmd      '.s:cmdarg.
             \                      '}'.
             \                      '+ '.s:filearg,
             \                      ' !   ?procinput'.
             \                      ' !   ?autoaddlog'.
             \                      ' !   ?progress'.
-            \                      s:_r.repo.diffoptsstr.
+            \                      s:diffoptsstr.
             \                      '    ?cmd      '.s:cmdarg.
             \                      '}',
             \              'subs': [['\vbranch\s+\Vtype ""',
             \                           'pull': s:pullactions})
 let s:ignfiles=['patch', 'renames', 'copies', 'files', 'diff', 'open']
 call s:_f.postresource('ignfiles', s:ignfiles)
+call s:_f.postresource('diffopts', s:diffoptslst)
 "▶1 Completion helpers
 let s:compcmds=['new', 'vnew', 'edit',
             \   'leftabove vnew', 'rightbelow vnew',

plugin/aurum/drivers/git.vim

 "▶1
 scriptencoding utf-8
 if !exists('s:_pluginloaded')
-    execute frawor#Setup('0.1', {   '@aurum/repo': '4.1',
-                \                          '@/os': '0.1',
-                \                     '@/options': '0.0',
-                \   '@aurum/drivers/common/utils': '0.0',
-                \'@aurum/drivers/common/hypsites': '0.0',}, 0)
+    execute frawor#Setup('0.1', {'@aurum/drivers/common/hypsites': '0.0',
+                \                                   '@aurum/repo': '5.0',
+                \                   '@aurum/drivers/common/utils': '0.0',
+                \                                          '@/os': '0.1',
+                \                                     '@/options': '0.0',}, 0)
     finish
 elseif s:_pluginloaded
     finish

plugin/aurum/drivers/mercurial.vim

 "▶1
 scriptencoding utf-8
 if !exists('s:_pluginloaded')
-    execute frawor#Setup('0.2', {      '@/python': '0.0',
-                \                   '@aurum/repo': '4.0',
-                \                          '@/os': '0.0',
-                \                     '@/options': '0.0',
-                \   '@aurum/drivers/common/utils': '0.0',
-                \'@aurum/drivers/common/hypsites': '0.0',}, 0)
+    execute frawor#Setup('0.2', {'@aurum/drivers/common/hypsites': '0.0',
+                \                                   '@aurum/repo': '5.0',
+                \                   '@aurum/drivers/common/utils': '0.0',
+                \                                      '@/python': '0.0',
+                \                                          '@/os': '0.0',
+                \                                     '@/options': '0.0',}, 0)
     finish
 elseif s:_pluginloaded
     finish

plugin/aurum/drivers/subversion.vim

 "▶1
 scriptencoding utf-8
 if !exists('s:_pluginloaded')
-    execute frawor#Setup('0.1', {   '@aurum/repo': '4.0',
-                \                          '@/os': '0.0',
-                \   '@aurum/drivers/common/utils': '0.0',
-                \     '@aurum/drivers/common/xml': '0.0',
-                \'@aurum/drivers/common/hypsites': '0.0',}, 0)
+    execute frawor#Setup('0.1', {'@aurum/drivers/common/hypsites': '0.0',
+                \                                   '@aurum/repo': '5.0',
+                \                   '@aurum/drivers/common/utils': '0.0',
+                \                     '@aurum/drivers/common/xml': '0.0',
+                \                                          '@/os': '0.0',}, 0)
     finish
 elseif s:_pluginloaded
     finish

plugin/aurum/edit.vim

     execute frawor#Setup('1.3', {'@/autocommands': '0.0',
                 \                   '@/functions': '0.0',
                 \                   '@/resources': '0.0',
-                \                   '@aurum/repo': '4.0',
+                \                   '@aurum/repo': '5.0',
                 \              '@aurum/lineutils': '0.0',
                 \                '@aurum/bufvars': '0.0',}, 0)
     call FraworLoad('@/autocommands')

plugin/aurum/repo.vim

 "▶1
 scriptencoding utf-8
 if !exists('s:_pluginloaded')
-    execute frawor#Setup('4.1', {'@/resources': '0.0',
+    execute frawor#Setup('5.0', {'@/resources': '0.0',
                 \                       '@/os': '0.0',
                 \                  '@/options': '0.0',
                 \           '@aurum/lineutils': '0.0',
-                \             '@aurum/bufvars': '0.0',}, 0)
+                \             '@aurum/bufvars': '0.0',
+                \                     '@aurum': '1.0',}, 0)
     finish
 elseif s:_pluginloaded
     finish
 let s:_options={
             \'diffopts':  {'default': {},
             \              'checker': 'dict {numlines         range 0 inf '.
-            \                               '?in diffoptslst  bool}'},
+            \                               '?in _r.diffopts  bool}'},
         \}
-" XXX Some code relies on the fact that all options from s:diffoptslst are
-"     numeric
-let s:diffoptslst=['git', 'reverse', 'ignorews', 'iwsamount', 'iblanks',
-            \      'numlines', 'showfunc', 'alltext', 'dates']
-let s:diffoptsstr=join(map(copy(s:diffoptslst),
-            \          'v:val is# "numlines" ? '.
-            \               '" ?".v:val." range 0 inf" : '.
-            \               '"!?".v:val'))
 let s:_messages={
             \    'nrm': 'Failed to remove file %s from repository %s',
             \  'iname': 'Error while registering driver for plugin %s: '.
     endif
     return repo
 endfunction
-"▶1 update
-" TODO Investigate whether this function should be moved to cmdutils, or to 
-" maputils which is probably to be created
-function s:F.update(repo, rev, count)
-    let rev=a:rev
-    if a:count>1
-        let rev=a:repo.functions.getnthparent(a:repo, rev, a:count-1).hex
-    endif
-    return a:repo.functions.update(a:repo, rev, 0)
-endfunction
 "▶1 Post resource
-call s:_f.postresource('repo', {'get': s:F.getrepo,
-            \                'update': s:F.update,
-            \           'diffoptslst': s:diffoptslst,
-            \           'diffoptsstr': s:diffoptsstr,})
+call s:_f.postresource('repo', {'get': s:F.getrepo,})
 "▶1 regdriver feature
 let s:requiredfuncs=['repo', 'getcs', 'checkdir']
 let s:optfuncs=['readfile', 'annotate', 'diff', 'status', 'commit', 'update',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.