Commits

ZyX_I committed 3a7edbf

@aurum/log: Added support for custom (per-repository) unique revision
identifiers ($hex word)
doc: Added has_merges documentation, made it more clear what is “cs.hex”

Comments (0)

Files changed (4)

     Determines whether repository has merges containing more then two parents. 
     In this case slower, but more universal algorithm will be used.
     This key is optional, default value: true.
+has_merges :: Bool                                     *aurum-repo.has_merges*
+    Determines whether repository history can contain any merges. If false, 
+    uses the fastest and the simplest graphing algorithm: “just draw a line in 
+    a first column”.
+    This key is optional, default value: true.
+hexreg :: Regex                                            *aurum-repo.hexreg*
+    Determines regular expression which must be matched by any |aurum-cs.hex| 
+    value. If present, this |regex| will be used in syntax rules generated by 
+    plugin/aurum/log, otherwise two syntax rules will be constructed: one rule 
+    that matches exactly 12 first hexadecimal numbers (|/\x|) followed by 
+    another rule than matches any positive number of hexadecimal characters 
+    and conceals them (requires |+conceal| to work properly).
 hasrevisions :: Bool                                 *aurum-repo.hasrevisions*
     Determines whether |aurum-cs.rev| contains something different from 
     abbreviated hash. If this option is false, then in log produced by 
 |aurum-rf-getcsprop|):
 
 Key          Description ~
-hex          Revision hash                                      *aurum-cs.hex*
+hex          Unique revision identifier (usually hash)          *aurum-cs.hex*
 rev          Revision number                                    *aurum-cs.rev*
 time         Time when cs was added (in second since epoch)    *aurum-cs.time*
 description  Changeset description                      *aurum-cs.description*
 |aurum-cs.rev| contains truncated hash (for use in |aurum://annotate|).
 |aurum-repo.cslist| is always empty
 |aurum-rf-status|: if at least one of first two optional arguments is 
-    non-zero, then then unknown and deleted files won’t be shown (if any).
+    non-zero, then then unknown and deleted files won’t be shown (if any). 
+    Ignored files are not shown in any case.
 |aurum-rf-gettiphex|: Same as |aurum-rf-getworkhex|.
 |aurum-rf-diff|: Options "git", "iblanks", "showfunc", "dates" are not 
     supported.
 |aurum-rf-diff|: Options "git", "iblanks", "dates", "alltext" are not 
     supported, option "reverse" is supported only if two revisions are given.
 |aurum-rf-status|: if at least one of first two optional arguments is 
-    non-zero, then then unknown and deleted files won’t be shown (if any).
+    non-zero, then then unknown and deleted files won’t be shown (if any). 
+    Ignored files are not shown in any case.
     Note: this function may output directories in a list.
 |aurum-rf-annotate| neither tracks renames/copies nor is able to output line 
     numbers.

plugin/aurum/drivers/subversion.vim

             \'status': {'added': [], 'removed': [], 'modified': []},
         \}
 let s:logstatchars={
-            \'C': 'modified',
             \'M': 'modified',
-            \'~': 'modified',
             \'R': 'modified',
             \'A': 'added',
             \'D': 'removed',
-            \'!': 'deleted',
-            \'?': 'unknown',
-            \'I': 'ignored',
         \}
 let s:hasdateexe=executable('date')
 " TODO HEAD, ... in cs.tags
                 \              'renames', 'copies', 'files', 'changes',
                 \              'removes'],
                 \'hypsites': deepcopy(s:hypsites),
-                \'has_merges': 0, 'iterfuncs': deepcopy(s:iterfuncs),}
+                \'has_merges': 0, 'iterfuncs': deepcopy(s:iterfuncs),
+                \'hexreg': '\v[1-9]\d*',}
     "▶2 Get svnprefix
     let str1='URL: '
     let str1lidx=len(str1)-1

plugin/aurum/log.vim

                     let r+=['syn match auLog_'.kw.' /'.arg.synreg.'/ '.
                                 \'contained nextgroup=']
                 elseif kw is# 'hex'
-                    call s:F.temp.addgroup(r, nlgroups, 'auLogHexStart')
-                    let r+=['syn match auLogHexStart /\v\x{12}/ contained'.
-                                \' nextgroup=auLogHexEnd',
-                            \'syn match auLogHexEnd /\v\x+/ contained '.
-                            \   (has('conceal')?('conceal'):('')).' nextgroup=']
+                    if has_key(a:repo, 'hexreg')
+                        call s:F.temp.addgroup(r, nlgroups, 'auLog_hex')
+                        let r+=['syn match auLog_hex /'.a:repo.hexreg.'/ '.
+                                    \'contained nextgroup=']
+                    else
+                        call s:F.temp.addgroup(r, nlgroups, 'auLogHexStart')
+                        let r+=['syn match auLogHexStart /\v\x{12}/ contained'.
+                                    \' nextgroup=auLogHexEnd',
+                                \'syn match auLogHexEnd /\v\x+/ contained '.
+                                \   (has('conceal')?('conceal'):('')).
+                                \   ' nextgroup=']
+                    endif
                 elseif kw is# 'patch'
                     call s:F.temp.addgroup(r, nlgroups,
                                 \'auLogPatchAdded,auLogPatchRemoved,'.
                 elseif (index(s:kwpempt, kw)!=-1 || kw is# 'branch' ||
                             \                       kw is# 'rev') &&
                             \(has_key(arg, 'pref') || has_key(arg, 'suf'))
+                    " Case kw=='rev' with !repo.hasrevisions is caught in the 
+                    " first branch
+                    let trail=((kw is# 'rev' || index(s:kwpempt, kw)==-1)?
+                                    \   (''):
+                                    \   (','))
                     if has_key(arg, 'pref')
-                        call s:F.temp.addgroup(r,nlgroups,'auLog_'.kw.'_pref,')
+                        call s:F.temp.addgroup(r,nlgroups,'auLog_'.kw.'_pref'.
+                                    \          trail)
                         let r+=['syn match auLog_'.kw.'_pref '.
                                     \'/\V'.escape(arg.pref, '\/').'/ '.
                                     \'contained nextgroup=auLog_'.kw]
                     else
-                        call s:F.temp.addgroup(r, nlgroups, 'auLog_'.kw.',')
+                        call s:F.temp.addgroup(r, nlgroups, 'auLog_'.kw.trail)
                     endif
                     let nextlit=get(arg, 'suf', get(lit, j+1, 0))
                     let r+=['syn match auLog_'.kw.' '.

syntax/aurumlog.vim

     hi auLogSkipBefore_rev ctermfg=DarkYellow  guifg=DarkYellow
     hi auLogHexStart       ctermfg=DarkYellow  guifg=DarkYellow
 endif
+hi def link auLog_hex auLogHexStart
 
 let b:current_syntax=expand('<sfile>:t:r')