[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Automation - is file versioned

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sun, 11 Oct 2009 09:17:20 +0200

On 11.10.2009 02:59, alexia wrote:
> Hi all,
> I want to automate TortoiseSVN. Is there ant command line which I can
> tell if a file is in repository (versioned).
> The reason for that is that I want to display the user different menu
> items if the file is versioned and if it is not.

Starting a new process every time you show a context menu? That's not a
good idea because it takes way too long - a context menu has to show up

You should consider using the svn libraries directly and use the
corresponding APIs to find out whether a file is versioned or not.

You *could* use SubWCRev (either the command line or the COM object) to
find out if a file is versioned. I would suggest using the COM object
for this.
Example in javascript:

filesystem = new ActiveXObject("Scripting.FileSystemObject");
subwcrevObject = new ActiveXObject("SubWCRev.object");
subwcrevObject.GetWCInfo(filesystem.GetAbsolutePathName("file.txt"), 1, 1);

if (subwcrevObject.IsSvnItem)
   WScript.Echo("file is versioned);
   WScript.Echo("file is not versioned);



   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-10-11 09:17:28 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.