How to delete Vault file while leaving the file system file?

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
tdacon
Posts: 5
Joined: Fri Feb 25, 2005 5:21 pm

How to delete Vault file while leaving the file system file?

Post by tdacon » Mon Dec 28, 2015 2:11 pm

Using ServerOperations.ProcessCommandDelete to delete a file or group of files from the repository, both the Vault files and the files in the working directory get deleted. I would like the option of leaving the underlying file system files untouched. The Visual Studio IDE plug-in (enhanced client) can do this, but I can't find the magic in the help file. Can anyone help me with this? I'm on the 7.2.1 version of the .NET VaultLib API, Visual Studio 2013.

Thanks,
Tom

-----

SourceGear Moderator : Note, this post was moved to the "Questions (API)" forum.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: How to delete Vault file while leaving the file system f

Post by jclausius » Mon Dec 28, 2015 2:47 pm

If you take a look at ServerOperations.ProcessCommandDelete() in the API source code, it basically constructs a ChangeSetItem_DeleteFile or ChangeSetItem_DeleteFolder item, and then calls commitTransaction(). commitTransaction() in turn calls the local ClientInstance.Commit() with default 2nd and 3rd arguments for keeping files checked out and removing local copies.

You'll need to implement something similar to these methods, but instead call your own .Commit() with the 3rd argument set to NOT remove local copies.

HTH
Jeff Clausius
SourceGear

Post Reply