identify via 'svn info'
authorBob Hiestand <bob.hiestand@gmail.com>
Tue, 18 Oct 2011 15:50:12 +0000 (18 10:50 -0500)
committerBob Hiestand <bob.hiestand@gmail.com>
Tue, 18 Oct 2011 15:50:12 +0000 (18 10:50 -0500)
don't look for .svn directories as svn 1.7 breaks that method

plugin/vcssvn.vim

index ba1aa70..ecc2543 100644 (file)
@@ -89,22 +89,17 @@ endfunction
 
 " Function: s:svnFunctions.Identify(buffer) {{{2
 function! s:svnFunctions.Identify(buffer)
-       let fileName = resolve(bufname(a:buffer))
-       if isdirectory(fileName)
-               let directoryName = fileName
-       else
-               let directoryName = fnamemodify(fileName, ':h')
-       endif
-       if strlen(directoryName) > 0
-               let svnDir = directoryName . '/.svn'
-       else
-               let svnDir = '.svn'
-       endif
-       if isdirectory(svnDir)
-               return 1
-       else
-               return 0
-       endif
+       let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer)))
+       try
+               call s:VCSCommandUtility.system(s:Executable() . ' info .')
+               if(v:shell_error)
+                       return 0
+               else
+                       return g:VCSCOMMAND_IDENTIFY_EXACT
+               endif
+       finally
+               call VCSCommandChdir(oldCwd)
+       endtry
 endfunction
 
 " Function: s:svnFunctions.Add() {{{2