Commits

ZyX_I committed 297135d Merge

Merge

  • Participants
  • Parent commits 1a30b96, 64ae745
  • Branches svnsupport

Comments (0)

Files changed (4)

plugin/aurum/drivers/git.vim

 endfunction
 "▶1 git.diffname :: _, line, diffre, _ → rpath
 function s:git.diffname(repo, line, diffre, opts)
-    return s:F.refile(get(matchlist(a:line, a:diffre), 1, 0))[2:]
+    let file=get(matchlist(a:line, a:diffre), 1, 0)
+    if file is 0
+        return 0
+    else
+        return s:F.refile(file)[2:]
+    endif
 endfunction
 "▶1 nullnl :: [String] → [String]
 " Convert between lines (NL separated strings with NULLs represented as NLs) and 

plugin/aurum/repo.vim

     let llines=len(a:diff)
     let stats={'files': {}, 'insertions': 0, 'deletions': 0}
     let file=0
+    let pmlines=0
     while i<llines
         let line=a:diff[i]
-        if line[:3] is# 'diff'
-            let file=a:repo.functions.diffname(a:repo, line, diffre, a:opts)
-            if file isnot 0
-                let stats.files[file]={'insertions': 0, 'deletions': 0,}
-                let i+=1
-                let oldi=i
-                let pmlines=2
-                while pmlines && i<llines
-                    let lstart=a:diff[i][:2]
-                    if lstart is# '+++' || lstart is# '---'
-                        let pmlines-=1
-                    endif
-                    let i+=1
-                    if i-oldi>=4
-                        let i=oldi
-                        break
-                    endif
-                endwhile
-                continue
+        let newfile=a:repo.functions.diffname(a:repo, line, diffre, a:opts)
+        if newfile isnot 0
+            let file=newfile
+            let stats.files[file]={'insertions': 0, 'deletions': 0,}
+            let pmlines=2
+        elseif file is 0
+        elseif pmlines
+            let lstart=line[:2]
+            if lstart is# '+++' || lstart is# '---'
+                let pmlines-=1
             endif
-        elseif file is 0
         elseif line[0] is# '+'
             let stats.insertions+=1
             let stats.files[file].insertions+=1

test/drivers-git.ok

Binary file modified.

test/drivers-subversion.ok

 |  Commited 08 Янв 2012 20:45 by zyx
 |  Files: file-under-svn-control
 |  @ Replaced “Fourth” with “4’th”
-|  $0 files changed, 0 insertions, 0 deletions
+|  $  file-under-svn-control | 1 1
+|  $1 files changed, 1 insertions, 1 deletions
 |  :Index: file-under-svn-control
 |  :===================================================================
 |  :--- file-under-svn-control	(revision 4)
 |  @ Added def, ghi, mno
 |  @ Added subdir/pqr
 |  @ Added subdir2, subdir2/stu
-|  $0 files changed, 0 insertions, 0 deletions
+|  $  def                    | 1 0
+|  $  file-under-svn-control | 1 0
+|  $  ghi                    | 1 0
+|  $  mno                    | 1 0
+|  $  subdir/pqr             | 1 0
+|  $  subdir2/stu            | 1 0
+|  $6 files changed, 6 insertions, 0 deletions
 |  :Index: ghi
 |  :===================================================================
 |  :--- ghi	(revision 0)
 |  Commited 08 Янв 2012 20:45 by zyx
 |  Files: --force
 |  @ Added --force
-|  $0 files changed, 0 insertions, 0 deletions
+|  $  --force | 1 0
+|  $1 files changed, 1 insertions, 0 deletions
 |  :Index: --force
 |  :===================================================================
 |  :--- --force	(revision 0)