Page 1 of 1

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

Posted: Mon Dec 28, 2015 2:11 pm
by tdacon
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.

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

Posted: Mon Dec 28, 2015 2:47 pm
by jclausius
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