Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implove log parse.

  • Loading branch information...
commit 11b6dd6a675ce92009545e5e892724bb3e69c2df 1 parent c95f749
@hrsh7th authored
Showing with 10 additions and 5 deletions.
  1. +0 −1  autoload/vcs/git/log.vim
  2. +10 −4 autoload/vcs/svn/log.vim
View
1  autoload/vcs/git/log.vim
@@ -34,7 +34,6 @@ function! s:parse(target, list)
\ "revision": v:val[0],
\ "prev_revision": v:val[1],
\ "author": v:val[2],
- \ "email": v:val[3],
\ "date": v:val[4],
\ "message": v:val[5],
\ "path": a:target
View
14 autoload/vcs/svn/log.vim
@@ -24,14 +24,20 @@ function! s:str2list(str)
endfunction
function! s:extract(list)
- return filter(map(a:list, "split(v:val, '\n')"), "len(v:val) > 0")
+ let list = filter(map(a:list, "filter(split(v:val, '\n'), 'strlen(v:val)')"), "len(v:val)")
+ let list = map(list, "[split(v:val[0], '|'), v:val[1]]")
+ let list = map(list, "[map(v:val[0], \"substitute(v:val, '^\\\\s*\\\\|\\\\s*$', '', 'g')\"), v:val[1]]")
+ let list = filter(list, "exists('v:val[0][0]') && exists('v:val[0][1]') && exists('v:val[0][2]')")
+ let list = map(list, "exists('v:val[1]') ? [v:val[0], v:val[1]] : [v:val[0], '']")
+ return list
endfunction
function! s:parse(target, list)
let logs = map(a:list, "{
- \ 'revision': substitute(split(v:val[0], '|')[0], '[^[:digit:]]', '', 'g'),
- \ 'author': split(v:val[0], '|')[1],
- \ 'message': v:val[2],
+ \ 'revision': join(split(v:val[0][0], 'r')),
+ \ 'author': v:val[0][1],
+ \ 'date': join(split(v:val[0][2], ' ')[0:1], ' '),
+ \ 'message': v:val[1],
\ 'path': a:target
\ }")
Please sign in to comment.
Something went wrong with that request. Please try again.