ramccor / vcscommand

Automatically exported from code.google.com/p/vcscommand
0 stars 0 forks source link

Problems using Mercurial on Windows #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Running on Win7/64, Vim72, Mercurial.
2. Try to run just about any VCSCommand command.

What is the expected output? What do you see instead?

What I saw originally when I ran any command was: 'No suitable plugin.'  
Tracked that down, I think, to the buffer variable b:vcsType not being set at 
all.  If I manually set b:vcsType to 'HG' I can get things to go through to 
point where it issues command:

return call('system',a:000)

but that returns an error stating:

"Version control command failed: ''hg''is not recognized as an internal or 
external command, operable program, or batch file."

The problem, I think is the quoting of ''hg'' in a:000.  I can run the 
identical command manually if I remove those quotes.  For example,

I can run this command fine manually:

   echo call('system',['hg diff -- "myfile.vim"'] 

The problem is that the line in VCSCommand is this:

   return call('system',['''hg'' diff -- "myfile.vim"'] 

What version of the product are you using? On what operating system?
Using Sep-2010 version of VCSCommand, Vim72, Win7/64.

Please provide any additional information below.

Original issue reported on code.google.com by hes...@gmail.com on 22 Sep 2010 at 8:06

GoogleCodeExporter commented 9 years ago
A little more info:

I tracked the ''hg'' problem down to the s:Executable() function in VCShg.vim.

If I remove the shellslash function wrapper from the return line, the proper 
(unquoted) hg string is returned.

Original comment by hes...@gmail.com on 22 Sep 2010 at 8:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Do you mean the 'shellescape()' wrapper?

Do you have the 'shellslash' variable set?

Original comment by bob.hies...@gmail.com on 4 Oct 2010 at 2:55

GoogleCodeExporter commented 9 years ago
I have similar problem with git on Win7 & Gvim 7.3
Setting / unsetting shellslash has no effect.

For example, command passed with shellslash set is:
cmd.exe /c "'git' rev-parse --is-inside-work-tree 
>C:\Users\jaah\AppData\Local\Temp\VIoD11.tmp 2>&1"

and without it:
cmd.exe /c ""git" rev-parse --is-inside-work-tree 
>C:\Users\jaah\AppData\Local\Temp\VIoB7EF.tmp 2>&1"

Failing with command not found.

Original comment by jahadutal on 27 Oct 2010 at 1:47

GoogleCodeExporter commented 9 years ago
It seems the best action is to not attempt to escape the executable name.  It 
will be up to the end user to escape it properly if it contains spaces.

Original comment by bob.hies...@gmail.com on 10 Nov 2010 at 2:11

GoogleCodeExporter commented 9 years ago
What is the value of your 'sxq' variable?

Original comment by bob.hies...@gmail.com on 11 Nov 2010 at 3:53

GoogleCodeExporter commented 9 years ago
Bob -- my sxq appears to be an empty string.

Original comment by hes...@gmail.com on 11 Nov 2010 at 4:43

GoogleCodeExporter commented 9 years ago
sxq is  ""
Maybe its better to escape things somewhere upper? Looking to another plugin - 
vimclojure:
http://bitbucket.org/kotarak/vimclojure/src/tip/vim/autoload/vimclojure.vim#cl-4
02 
http://bitbucket.org/kotarak/vimclojure/src/tip/vim/autoload/vimclojure.vim#cl-5
35
- escaping the full line than the executable.

Original comment by jahadutal on 11 Nov 2010 at 4:53

GoogleCodeExporter commented 9 years ago
That escapes the executable and each argument individually, which wouldn't 
help.  The issue is that shellescape() does not work on your system.

Original comment by bob.hies...@gmail.com on 11 Nov 2010 at 7:37

GoogleCodeExporter commented 9 years ago
Indeed it works. Running 'vim -V9vimlog' on my linux box.
...
Calling shell to execute: "('git' rev-parse --is-inside-work-tree) 
>/tmp/vEBYRQ0/0 2>&1"
...
While calling 'git'/"git" in linux calls git anyway, this seems wrong to cmd.exe

And look same with vimclojure
...
Calling shell to execute: "('ng' 'vimclojure.Nail' 'NamespaceOfFile' 
</tmp/v21N5Pi/0) >/tmp/v21N5Pi/1 2>&1"
...

I'm talking about this. Sorry I've not provided this in first place.

Original comment by jahadutal on 11 Nov 2010 at 8:06

GoogleCodeExporter commented 9 years ago
Windows:
...
Calling shell to execute: """ng" "vimclojure.Nail" "NamespaceOfFile 
<C:\Users\jaah\AppData\Local\Temp\VIA1F6C.tmp" 
>C:\Users\jaah\AppData\Local\Temp\VIo1F7C.tmp 2>&1"

...
Calling shell to execute: ""git" rev-parse --is-inside-work-tree 
>C:\Users\jaah\AppData\Local\Temp\VIoB6CA.tmp 2>&1"
...

Original comment by jahadutal on 11 Nov 2010 at 8:17

GoogleCodeExporter commented 9 years ago
Ok. Partly got the problem. Installed msysgit with only git.cmd in path, 
somehow couldn't find the "git.exe". cmd-file would set the %PATH% with current 
file path, not with the bin dir of msysgit.
Thats why it argued about not-found-executable.
Just tried with test Mercurial repo and all is fine.

Seems it's all ok with vcscommand.

Original comment by jahadutal on 11 Nov 2010 at 8:56

GoogleCodeExporter commented 9 years ago
I have the same problem. When set shellflash, the vcs report 'No suitable 
plugin.'
, and If not set shellflash, it's ok.

Platform: Win7 64/32, Vim 7.3, Mercurial 1.7.1

I used the vim-latex plugin to work with vcscommand, the vim-latex plugin need 
to set  shellflash.

Original comment by tux...@gmail.com on 10 Jan 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Tux, you should probably talk to the author of vim-latex.  Bram has been pretty 
adamant about not changing the behavior related to shellslash and maintains 
that people are using it wrong.

That said, please try the following version of the plugin; it removes use of 
shellescape which may fix it for you:

http://repo.or.cz/w/vcscommand.git/snapshot/029f92d52fd5bb5d3f8fbbcfc0f32dca660a
a1e9.zip

Original comment by bob.hies...@gmail.com on 23 Feb 2011 at 5:19

GoogleCodeExporter commented 9 years ago
Closing due to inactivity.

Original comment by bob.hies...@gmail.com on 2 Jun 2011 at 9:01