Page 1 of 1

Query/Reset File status using C#

Posted: Tue Mar 08, 2016 1:59 am
by tschneider
Hello,

how can i query the file status of an open project using VAULT API.
I want to get all files of Status=Renegade and reset it using API?

best
Thomas

Re: Query/Reset File status using C#

Posted: Tue Mar 08, 2016 8:46 am
by Beth
Are the files Renegade because there are changes? Or are they renegade because they were touched by a program? If there are changes, do you need to keep those changes?

Re: Query/Reset File status using C#

Posted: Tue Mar 08, 2016 9:04 am
by tschneider
There are changes and i want to reset them by API.

Re: Query/Reset File status using C#

Posted: Tue Mar 08, 2016 12:04 pm
by Beth
To get rid of renegade changes, you would have to perform a Get with overwrite. If you need to keep the changes, then your options are to check out the file and check it in, or to keep a renegade status, or to switch to using CVS mode which keeps all the files writable.

For example, to do the Get with overwrite:
  • a) Call
    ClientInstance.GetWorkingFolder(VaultClientFolder) OR ClientInstance.GetWorkingFolder(String strPhysicalDiskPath, true)

    to get a working folder instance.

    b) With the Working Folder object returned from step A, call

    WorkingFolder.GetStatus() or WorkingFolder.GetStatusForAllFiles()

    This would return the status of a known VaultClientFile or the files found in a known VaultClientFolder.

    c) Call GET() with the file's same version/object version id, the 'forceLatest' set to false, and overwrite set to true.