changeset 2637:fcfd46c4a27a

HGcommand.vim : the status was read for the wrong file as we changed the current directory before
author "Mathieu Clabaut <mathieu.clabaut@gmail.com>"
date Wed, 19 Jul 2006 09:28:59 +0200
parents 733fff9b23f7
children 8dadff054acf
files contrib/vim/hgcommand.vim
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/vim/hgcommand.vim	Tue Jul 18 18:35:47 2006 +0200
+++ b/contrib/vim/hgcommand.vim	Wed Jul 19 09:28:59 2006 +0200
@@ -322,7 +322,7 @@
   let fileName=bufname(hgBufferCheck)
   let fileNameWithoutLink=s:HGResolveLink(fileName)
   let realFileName = fnamemodify(fileNameWithoutLink, ':t')
-  let oldCwd=s:HGChangeToCurrentFileDir(fileName)
+  let oldCwd=s:HGChangeToCurrentFileDir(realFileName)
   try
     let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " root  " 
     let roottext=system(hgCommand)
@@ -332,14 +332,14 @@
       return ""
     endif
     let returnExpression = ""
-    let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " status -mardui " . fileName
+    if a:repositoryVar != ""
+      let returnExpression=returnExpression . " | let " . a:repositoryVar . "='" . roottext . "'"
+    endif
+    let hgCommand = s:HGGetOption("HGCommandHGExec", "hg") . " status -mardui " . realFileName
     let statustext=system(hgCommand)
     if(v:shell_error)
       return ""
     endif
-    if a:repositoryVar != ""
-      let returnExpression=returnExpression . " | let " . a:repositoryVar . "='" . roottext . "'"
-    endif
     if match(statustext, '^[?I]') >= 0 
       let revision="NEW"
     elseif match(statustext, '^[R]') >= 0 
@@ -1677,6 +1677,11 @@
    may still be bugs in here, depending on many configuration details.
 
 ==============================================================================
+
+9. TODO  						      *hgcommand-todo*
+
+   Integrate symlink tracking once HG will support them.
+==============================================================================
 === END_DOC
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " v im:tw=78:ts=8:ft=help:norl: