##// END OF EJS Templates
Test if file is below an HG root before doing anything
"Mathieu Clabaut " -
r2634:105708ba default
parent child Browse files
Show More
@@ -171,7 +171,7 b' function! s:HGCreateCommandBuffer(cmd, c'
171 171 endif
172 172
173 173 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " " . a:cmd
174 echomsg "DBG :".hgCommand
174 "echomsg "DBG :".hgCommand
175 175 let hgOut = system(hgCommand)
176 176 " HACK: diff command does not return proper error codes
177 177 if v:shell_error && a:cmdName != 'hgdiff'
@@ -319,13 +319,17 b' function! s:HGGetStatusVars(revisionVar,'
319 319 return ""
320 320 endif
321 321 let fileName=bufname(hgBufferCheck)
322 let realFileName = fnamemodify(s:HGResolveLink(fileName), ':t')
322 let fileNameWithoutLink=s:HGResolveLink(fileName)
323 let realFileName = fnamemodify(fileNameWithoutLink, ':t')
323 324 let oldCwd=s:HGChangeToCurrentFileDir(fileName)
324 325 try
325 ""TODO
326 "if !filereadable('HG/Root')
327 "return ""
328 "endif
326 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " root "
327 let roottext=system(hgCommand)
328 " Suppress ending null char ! Does it work in window ?
329 let roottext=substitute(roottext, '.$', '', "")
330 if match(getcwd()."/".fileNameWithoutLink, roottext) == -1
331 return ""
332 endif
329 333 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " status -mardui " . fileName
330 334 let statustext=system(hgCommand)
331 335 if(v:shell_error)
@@ -686,7 +690,7 b' function! s:HGAnnotate(...)'
686 690 endif
687 691
688 692 let resultBuffer=s:HGDoCommand('annotate -ndu -r ' . revision, 'hgannotate', revision)
689 echomsg "DBG: ".resultBuffer
693 "echomsg "DBG: ".resultBuffer
690 694 if resultBuffer != -1
691 695 set filetype=HGAnnotate
692 696 endif
General Comments 0
You need to be logged in to leave comments. Login now