On 02.10.2014 13:10, Wolfgang Kleinschmit wrote:
> Hi all,
> I want to use the Repository Browser from my own application, to enable
> the user to select a path in a repository. Much in the same way as, for
> example, the first "..."-button on Tortoise's "Checkout"-dialog does.
> In fact, my configuration is just the same: A text-box next to a button
> labeled "...".
> Clicking said button calls TortoiseProc.exe like this:
> TortoiseProc |/command|:repobrowser /outfile:"..."/path:"..."
> where /outfile points to a newly created, empty temporary file and /path
> is either missing (leaving TortoiseProc to ask for an initial path) or
> gives the path that was in the text-box before.
> This works all well... with one exception:
> The user might click the "Ok"-button or the "Cancel"-button, the result
> is always the same.
> The exit-code of TortoiseProc is 0 in any case and the temporary file
> given by /outfile always contains the last selected repository path.
> I have checked the source-code and in RepositoryBrowserCommand.cpp, line
> 107, the result of dlg.DoModal(); is, indeed, just silently ignored.
> My suggestion would be to either
> * return a non-zero exit code from TortoiseProc if the dialog was
> This, however, might have the drawback of breaking existing code
> since it's not really an error.
> But then again, since most TortoiseProc commands spawn some kind of
> dialog, this could be made a general rule and some special
> exit-code, say 1, could be dedicated to signal the "User canceled
> the operation" condition.
> * Do not write the /outfile at all or, even better, make sure it
> exists but is empty.
> This, again, might break some existing code. So maybe it's still
> better to:
> * Add a third line to the output file, saying either "Ok" or "Cancel".
> Thanks for reading this and please let me know your comments.
I'll go with the option of leaving the outfile empty in case the dialog
was cancelled. I guess that's what should have been done all along.
I also opened issue #667 for this:
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2014-10-06 19:29:31 CEST