##// 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 endif
171 endif
172
172
173 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " " . a:cmd
173 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " " . a:cmd
174 echomsg "DBG :".hgCommand
174 "echomsg "DBG :".hgCommand
175 let hgOut = system(hgCommand)
175 let hgOut = system(hgCommand)
176 " HACK: diff command does not return proper error codes
176 " HACK: diff command does not return proper error codes
177 if v:shell_error && a:cmdName != 'hgdiff'
177 if v:shell_error && a:cmdName != 'hgdiff'
@@ -319,13 +319,17 b' function! s:HGGetStatusVars(revisionVar,'
319 return ""
319 return ""
320 endif
320 endif
321 let fileName=bufname(hgBufferCheck)
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 let oldCwd=s:HGChangeToCurrentFileDir(fileName)
324 let oldCwd=s:HGChangeToCurrentFileDir(fileName)
324 try
325 try
325 ""TODO
326 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " root "
326 "if !filereadable('HG/Root')
327 let roottext=system(hgCommand)
327 "return ""
328 " Suppress ending null char ! Does it work in window ?
328 "endif
329 let roottext=substitute(roottext, '.$', '', "")
330 if match(getcwd()."/".fileNameWithoutLink, roottext) == -1
331 return ""
332 endif
329 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " status -mardui " . fileName
333 let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " status -mardui " . fileName
330 let statustext=system(hgCommand)
334 let statustext=system(hgCommand)
331 if(v:shell_error)
335 if(v:shell_error)
@@ -686,7 +690,7 b' function! s:HGAnnotate(...)'
686 endif
690 endif
687
691
688 let resultBuffer=s:HGDoCommand('annotate -ndu -r ' . revision, 'hgannotate', revision)
692 let resultBuffer=s:HGDoCommand('annotate -ndu -r ' . revision, 'hgannotate', revision)
689 echomsg "DBG: ".resultBuffer
693 "echomsg "DBG: ".resultBuffer
690 if resultBuffer != -1
694 if resultBuffer != -1
691 set filetype=HGAnnotate
695 set filetype=HGAnnotate
692 endif
696 endif
General Comments 0
You need to be logged in to leave comments. Login now