Add TortoiseSVN actions in TC toolbar.

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
wimille
Junior Member
Junior Member
Posts: 9
Joined: 2011-08-31, 12:29 UTC

Add TortoiseSVN actions in TC toolbar.

Post by *wimille »

Hi,

i use TC with TortoiseSVN and all works fine.

But, i want more.

I want to create Toolbar buttons for some SVN actions (add, commit, update).
So i create a button with these parameters :

Code: Select all

Cmd : c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe
Para : /command:commit /path:"%p%n" /notempfile /closeonend:3
Icon : c:\Program Files\TortoiseSVN\bin\tortoiseproc.exe, 11
It's work but not exactly how i've expected. It i select multiple files, in this case, svn will only take the file which is currently selected, not all the selection.

So, i think my parameters line is wrong, specially the option /path:, but i don't know how to write it correctly.

Thanks for your answers.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

specially the option /path
Appendix D. Automating TortoiseSVN wrote:Since some of the commands can take a list of target paths (e.g. committing several specific files) the /path parameter can take several paths, separated by a * character.
%P%N is only the file under the cursor.
%P%S insert the names of all selected files into the command line, with full path. Names containing spaces will be surrounded by double quotes. Do NOT put quotes around %P%S yourself!
is near to what you need, but this is missing the asterisk '*' between the selected files.

You can try to split the single call in multiple calls using a tool like lst2multi or do some batch/script programming to create a single command line for this (let me call it rude) syntax needed by TortoiseProc.

Regards
Holger
wimille
Junior Member
Junior Member
Posts: 9
Joined: 2011-08-31, 12:29 UTC

Post by *wimille »

Thanks for your answer.
I didn't know this addon, and it seems very useful.

But, in case of TortoiseSVN, the exe need some extra parameter.

And it seems not to work with lst2multi.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

HolgerK wrote:You can try to split the single call in multiple calls using a tool like lst2multi or do some batch/script programming...

Code: Select all

TOTALCMD#BAR#DATA
%COMSPEC%
FOR /F "tokens=*" %%i in (%L) DO "c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe"  /command:commit /path:"%%i" /notempfile /closeonend:3
%COMSPEC%



-1
- Mark the code block
- Copy the text into clipboard
- Paste it into the button bar

HTH
Holger
wimille
Junior Member
Junior Member
Posts: 9
Joined: 2011-08-31, 12:29 UTC

Post by *wimille »

Thanks for your answer.

But, please forgive me if i talk like a noob, but after i've created my button,
i select files i want and i click on the button.

But nothing happens. A DOS windows has been opened and then closed before i see anything, and no commit are made.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Sorry, my fault.
Please modify the command to

Code: Select all

%COMSPEC% /C
You can debug the output of the executed commands using

Code: Select all

%COMSPEC% /K
Regards
Holger
wimille
Junior Member
Junior Member
Posts: 9
Joined: 2011-08-31, 12:29 UTC

Post by *wimille »

Thank you.
My goal is so close.

I think, i make a script to do this. that's why :
if i use your command (which works fine by the way), tortoise open a window for each file. But, i want only one which list all files.

to do that, i need to put all selected in a string, separated by '*' and after use this string with TortoiseProc command.
wimille
Junior Member
Junior Member
Posts: 9
Joined: 2011-08-31, 12:29 UTC

Post by *wimille »

Well, at last i made a perl script which get file list from TC, manage file list to commit and then commit with TortoiseSVN.

Why Perl? Because i know it a little. But it's much more than batch file :).


Thank to HolgerK and his advices.
xiaomm250
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-03, 09:43 UTC

Re:

Post by *xiaomm250 »

wimille wrote: 2011-09-02, 11:22 UTC Well, at last i made a perl script which get file list from TC, manage file list to commit and then commit with TortoiseSVN.

Why Perl? Because i know it a little. But it's much more than batch file :).


Thank to HolgerK and his advices.
can you give me the perl code?
I want to know how to call perl script from tc
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Add TortoiseSVN actions in TC toolbar.

Post by *Usher »

So you are talking about 10 years old code...
And you are asking a user which last activity was in 2018-02-15...
What do you expect?
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Add TortoiseSVN actions in TC toolbar.

Post by *Horst.Epp »

Whats the problem to call a Perl script from TC ?
Define a button which invokes the script and use the help
to see what parameters you can provide to the script.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
xiaomm250
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-03, 09:43 UTC

Re: Add TortoiseSVN actions in TC toolbar.

Post by *xiaomm250 »

Horst.Epp wrote: 2021-12-04, 13:48 UTC Whats the problem to call a Perl script from TC ?
Define a button which invokes the script and use the help
to see what parameters you can provide to the script.
my em command as follow

Code: Select all

[em_DeleteBlankLines]
cmd="%COMMANDER_PATH%\script\DeleteBlankLines.pl"
param="%L"
menu=call perl to delete blank lines
my perl code

Code: Select all

use strict;use warnings;use diagnostics;
my @files=<$ARGV[0]>;#read filenames from %L
foreach my $file (@files)
{
    open(my $FHa,'<',$file);
    my @data=<$FHa>;
    close($FHa);
    open(my $FHb,'>',$file);
    foreach my $line (@data)
    {
        chomp($line);
        if($line=~m/^\s*$/)
        {
            next;
        }
        print $FHb "$line\n";
    }
    close($FHb);
}
I dont konw what is wrong,can you help me?
Post Reply