Using tortoiseproc to open tortoisemerge automatically?

251 views
Skip to first unread message

Josh Reynolds

unread,
Feb 21, 2012, 3:16:43 PM2/21/12
to us...@tortoisesvn.tigris.org
I'm trying to figure out how to use the command line switches for
tortoiseproc to cause tortoisemerge to open up and show me my working
copy modifications to a file automatically, so I can run it as an
external tool from within my code editor. I use editplus for most of my
php coding needs, and it would be useful to be able to hit ctrl-3 and
immediately see my modifications to the current file. Editplus calls
them "user tools", most other editors have similar capabilities.


I played around with tortoiseproc.exe /command:showcompare and got this
to almost work:

"c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:showcompare
/url1:d:\temp\testsvn\blahnewfile.cs /revision1:BASE
/url2:d:\temp\testsvn\blahnewfile.cs /revision2:

d:\temp\testsvn\blahnewfile.cs is a file with local modifications, but
it just shows me the diff between the base and base revisions, so no
changes. Is there a way to specify "working copy version" for
/revision2, similar to how BASE can be used?

I'm still on tortoise 1.6.16 btw.


Also I did get it working with the following batch file, but it requires
a command line svn client. You might need to change %ProgramW6432% to
either %ProgramFiles% or %ProgramFiles(x86)% depending on whether your
windows and/or tortoise is 64 bit or 32 bit. Or just hard code it :)

-------------------------------------------------------


@echo off

rem strip path to get file name
SET B="%TEMP%\%~nx1_base"
SET C="%TEMP%\%~nx1_current"

rem delete old copies if they exist
if exist %B% del %B%
if exist %C% del %C%

rem export base and working copies of the file
svn export -rBASE %1 %B%
svn export %1 %C%

rem run tortoisemerge
"%ProgramW6432%\TortoiseSVN\bin\TortoiseMerge.exe" /base:%B% /mine:%C%

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2925182

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

Stefan Küng

unread,
Feb 22, 2012, 12:43:34 PM2/22/12
to us...@tortoisesvn.tigris.org
On 21.02.2012 21:16, Josh Reynolds wrote:
> I'm trying to figure out how to use the command line switches for
> tortoiseproc to cause tortoisemerge to open up and show me my working
> copy modifications to a file automatically, so I can run it as an
> external tool from within my code editor. I use editplus for most of my
> php coding needs, and it would be useful to be able to hit ctrl-3 and
> immediately see my modifications to the current file. Editplus calls
> them "user tools", most other editors have similar capabilities.
>
>
> I played around with tortoiseproc.exe /command:showcompare and got this
> to almost work:
>
> "c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:showcompare
> /url1:d:\temp\testsvn\blahnewfile.cs /revision1:BASE
> /url2:d:\temp\testsvn\blahnewfile.cs /revision2:
>
> d:\temp\testsvn\blahnewfile.cs is a file with local modifications, but
> it just shows me the diff between the base and base revisions, so no
> changes. Is there a way to specify "working copy version" for
> /revision2, similar to how BASE can be used?
>
> I'm still on tortoise 1.6.16 btw.

"showcompare" uses urls, and your passing *paths* to it.

What you want to use is the 'diff' command:

tortoiseproc /command:diff /path:"d:\temp\testsvn\blahnewfile.cs"

That's it.
As the docs for the 'diff' command say:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html#tsvn-automation-basics

"If /path2 is omitted, then the diff is done between the file in /path
and its BASE. To explicitly set the revision numbers use /startrev:xxx
and /endrev:xxx, and for the optional peg revision use /pegrevision:xxx."

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2925521

Josh Reynolds

unread,
Feb 22, 2012, 12:56:54 PM2/22/12
to us...@tortoisesvn.tigris.org
On 2/22/2012 12:43 PM, Stefan Küng wrote:
> On 21.02.2012 21:16, Josh Reynolds wrote:
>> I played around with tortoiseproc.exe /command:showcompare and got this
>> to almost work:
>>
>> "c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:showcompare
>> /url1:d:\temp\testsvn\blahnewfile.cs /revision1:BASE
>> /url2:d:\temp\testsvn\blahnewfile.cs /revision2:
>>
>> d:\temp\testsvn\blahnewfile.cs is a file with local modifications, but
>> it just shows me the diff between the base and base revisions, so no
>> changes. Is there a way to specify "working copy version" for
>> /revision2, similar to how BASE can be used?
>>
>> I'm still on tortoise 1.6.16 btw.
> "showcompare" uses urls, and your passing *paths* to it.
>
> What you want to use is the 'diff' command:
>
> tortoiseproc /command:diff /path:"d:\temp\testsvn\blahnewfile.cs"
>
> That's it.
> As the docs for the 'diff' command say:
> http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html#tsvn-automation-basics
>
> "If /path2 is omitted, then the diff is done between the file in /path
> and its BASE. To explicitly set the revision numbers use /startrev:xxx
> and /endrev:xxx, and for the optional peg revision use /pegrevision:xxx."
>
> Stefan
>


Doh, thank you! I should have read a little closer.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2925522

Reply all
Reply to author
Forward
0 new messages