Wednesday, April 11, 2007

Subversion in Delphi's Tools menu

Joe White writes about how to add Tools menu items with Subversion commands
here.

For some reason, the Submit button didn't work on his Comments page (running IE6), so I'll just write my comment here:

Nice, thanks!

I've been meaning to do the same thing for a while, but kept postponing it. Shame about the space-before-macro requirement in the Tools menu - you should probably log it in QC.

I didn't have Ruby installed so I wrote a simple online .Bat file instead:

"c:/program files/tortoisesvn/bin/tortoiseproc.exe" /command:%1 /path:%2 /notempfile

Then I create the Tools items with:
Program: c:\windows\system32\cmd.exe
Parameters: /C C:\SvnPas\Utils\Batch\SvnCmd.Bat diff $EDNAME $SAVEALL

Works fine!

6 comments:

Joe White said...

I tried it first with a .BAT file, but that doesn't work if you have spaces in your path. Delphi can't do macro expansion inside quotes, so it has to pass the file unquoted -- so the batch file sees it as multiple parameters (%2, %3, %4, etc.)

If there are no spaces in your path, though, the batch file works fine.

Tom Øyvind Hogstad said...

Nice, or you can just use the Delphi addin for Tortoise

http://delphiaddinfortortoisesvn.tigris.org/

Hallvard Vassbotn said...

Joe: You're right. "Luck" have it that we don't have spaces in our source paths ;)

Tom Øyvind:
> http://delphiaddinfortortoisesvn.tigris.org/

Right. I have on my todo-list to look into that and the alternative:

http://sourceforge.net/projects/delphisvn/

We've just started using SVN - from Explorer for now. It works fine - only the Show log command is irritatingly slow - seems to be a bug/issue with the Apache/https interface...

juliosaucedo said...

I have installed delphisvn plugin, from , and it works fine... but the most of times I use Tortoise in the windows shell and it rocks!

Fernando Madruga said...

Actually, that "space" problem in paths can be easily fixed, but only if you're running 4NT instead of CMD:

"c:/program files/tortoisesvn/bin/tortoiseproc.exe" /command:%1 /path:"%2$" /notempfile

As for CMD, it's not so easy, but still doable:

@ECHO OFF
SET _1=%1
SET _2=%2
SHIFT
:l
SHIFT
IF "%1" == "" GOTO done
SET _2=%_2% %1
GOTO l
:done
"c:/program files/tortoisesvn/bin/tortoiseproc.exe" /command:%_1% /path:"%_2%" /notempfile

Anonymous said...

javascript:document.location='http://www.albinoblacksheep.com/flash/you.html'

Sorry just testing.



Copyright © 2004-2007 by Hallvard Vassbotn