Commits

ZyX_I  committed 5066b53

Made AuGlog (and, perhaps, other commands) work in old vim (7.2.442) with old python (2.6.6-r1) and old mercurial (1.7.2)

  • Participants
  • Parent commits 0ef3476

Comments (0)

Files changed (4)

File ftplugin/aurumannotate.vim

 scriptencoding utf-8
 setlocal textwidth=0
 setlocal nolist nowrap
-setlocal concealcursor+=n conceallevel=2
-setlocal nonumber norelativenumber
+if has('conceal')
+    setlocal concealcursor+=n conceallevel=2
+endif
+setlocal nonumber
+if exists('+relativenumber')
+    setlocal norelativenumber
+endif
 setlocal noswapfile
 setlocal nomodeline
 if exists('s:_pluginloaded') && empty(getline('.'))

File ftplugin/aurumgraphlog.vim

 scriptencoding utf-8
 setlocal textwidth=0
 setlocal nolist nowrap
-setlocal concealcursor+=n conceallevel=2
-setlocal nonumber norelativenumber
+if has('conceal')
+    setlocal concealcursor+=n conceallevel=2
+endif
+setlocal nonumber
+if exists('+relativenumber')
+    setlocal norelativenumber
+endif
 setlocal noswapfile
 setlocal nomodeline
 if exists('s:_pluginloaded') && empty(getline('.'))
     let special.date_r=[[1, commitedlen], [1, commitedlen+len(date)]]
     let special.user_r=[[1, len(text[1])-len(a:cs.user)], [1, len(text[1])-1]]
     "▶3 Add bookmarks and tags
-    for key in filter(['tags', 'bookmarks'], '!empty(a:cs[v:val])')
+    for key in filter(['tags', 'bookmarks'], 'has_key(a:cs, v:val) && '.
+                \                            '!empty(a:cs[v:val])')
         let upkey=toupper(key[0]).key[1:-2]
+        let newtext=[upkey]
         if len(a:cs[key])>1
-            let newtext=[upkey.'s: '.join(a:cs[key], ', ')]
+            let newtext[0].='s: '.join(a:cs[key], ', ')
         else
-            let newtext=[upkey.': '.a:cs[key][0]]
+            let newtext[0].=': '.a:cs[key][0]
         endif
         let special[key.'_R']=[[len(text),                 0],
                     \           [len(text)+len(newtext)-1, 0]]

File python/aurum.py

     def get_renames_value(rename):
         return rename[0] if rename else 0
     cs=get_repo(path)[rev]
-    vim.eval('extend(a:cs.renames, '+nonutf_dumps(
-            {f: get_renames_value(cs.filectx(f).renamed()) for f in files})+')')
+    renames_vim={}
+    for f in files:
+        renames_vim[f]=get_renames_value(cs.filectx(f).renamed())
+    vim.eval('extend(a:cs.renames, '+nonutf_dumps(renames_vim)+')')
 
 def get_status(path, rev1=None, rev2=None):
     if rev1 is None and rev2 is None:

File syntax/aurumgraphlog.vim

 syn match auGlogChangesetNum      /\v\d+/      contained nextgroup=auGlogChangesetSep
 syn match auGlogChangesetSep      /:/          contained nextgroup=auGlogChangesetHexStart
 syn match auGlogChangesetHexStart /\v\x{12}/   contained nextgroup=auGlogChangesetHexEnd
-syn match auGlogChangesetHexEnd   /\v\x+/      contained nextgroup=auGlogBranch conceal
+if has('conceal')
+    syn match auGlogChangesetHexEnd   /\v\x+/      contained nextgroup=auGlogBranch conceal
+else
+    syn match auGlogChangesetHexEnd   /\v\x+/      contained nextgroup=auGlogBranch
+endif
 syn region auGlogBranch matchgroup=auGlogBranchDec start=/\V (branch / end=/\V)/ contains=auGlogBranchName oneline contained keepend
 syn match auGlogBranchName /\v \S+ \zs.{-}\ze\)/ contained