Closed GoogleCodeExporter closed 9 years ago
I do not use HG. However, I suspect the given patch isn't correct. Identify
should
determine whether the directory is under version control, not the file. Could
you
please test the following patch instead?
diff --git a/plugin/vcshg.vim b/plugin/vcshg.vim
index 0a31063..47cc61c 100644
--- a/plugin/vcshg.vim
+++ b/plugin/vcshg.vim
@@ -83,12 +83,17 @@ endfunction
" Function: s:hgFunctions.Identify(buffer) {{{2
function! s:hgFunctions.Identify(buffer)
- call system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' root')
- if(v:shell_error)
- return 0
- else
- return g:VCSCOMMAND_IDENTIFY_INEXACT
- endif
+ let oldCwd =
VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer)))
+ try
+ call system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . '
root')
+ if(v:shell_error)
+ return 0
+ else
+ return g:VCSCOMMAND_IDENTIFY_INEXACT
+ endif
+ finally
+ call VCSCommandChdir(oldCwd)
+ endtry
endfunction
" Function: s:hgFunctions.Add() {{{2
Original comment by bob.hies...@gmail.com
on 6 Jan 2010 at 8:57
good patch. it works well for me. Thank you.
Original comment by tocer.deng@gmail.com
on 7 Jan 2010 at 1:35
This should be fixed in 1.99.32.
Original comment by bob.hies...@gmail.com
on 7 Jan 2010 at 6:21
Original issue reported on code.google.com by
tocer.deng@gmail.com
on 21 Dec 2009 at 2:18Attachments: