Valut CommandLine delete local copy after CHECKIN
Moderator: SourceGear
Valut CommandLine delete local copy after CHECKIN
Is there an option to delete local copies after doing a checkin or commit? I have files in my working folder that either neeed to be checkin or added, so I'd like to run the CHECKIN, delete the files that were checked in, then run an ADD command to get the rest of the working directory.
Re: Valut CommandLine delete local copy after CHECKIN
This option isn't currently available in the Command Line Client.
I'll log a feature request for this functionality. It will be evaluated for an upcoming release of Vault. Thanks for the suggestion.
I'll log a feature request for this functionality. It will be evaluated for an upcoming release of Vault. Thanks for the suggestion.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: Valut CommandLine delete local copy after CHECKIN
DO you think it would be possible with the APIs? If so, could you maybe provide some simple code that chekns and deletes local files? I 've been researchingyour comanline source code, and can't quite get to the individual files to delete when checked in. Also is there a way via xml to read the comenys pu tout in the xml from a checkin? I'm using POwershell to do t his and it has nice XML parsing.
Any help would be appreciated.
Thanks, Bob
Any help would be appreciated.
Thanks, Bob
Re: Valut CommandLine delete local copy after CHECKIN
When you are checking in, are you checking in individual files or a folder? If it's individual files, then the delete portion becomes a windows command and not a Vault command. Even just a DOS command would take care of that then: http://www.computerhope.com/delhlp.htm.
If you want to use our API rather than the command line, then where you want to start is by downloading the API from our downloads pages for the version you have. In the zip file is a .chm with all the API documentation. We also have a section of the forum with lots of examples on the API: http://support.sourcegear.com/viewforum.php?f=39.
If you want to use our API rather than the command line, then where you want to start is by downloading the API from our downloads pages for the version you have. In the zip file is a .chm with all the API documentation. We also have a section of the forum with lots of examples on the API: http://support.sourcegear.com/viewforum.php?f=39.
I'm not sure I'm understanding the question. Is there a reason to not continue using Powershell for your XML parsing?Also is there a way via xml to read the comenys pu tout in the xml from a checkin? I'm using POwershell to do t his and it has nice XML parsing.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Valut CommandLine delete local copy after CHECKIN
The command adds Folders. If one item in the folder already exists in SourceGear on an ADD command, the whole transaction rolls back. Is there an option to ignore files that already exist and have the ADD command bypass the files already in SourceGear?
Thanks, Bob
Thanks, Bob
Re: Valut CommandLine delete local copy after CHECKIN
There currently isn't an option to ignore items that already exist. I can add a feature request if you would like.
An option you have is to look at your Pending Change Set window, and undo the duplicate items, and then commit the rest.
An option you have is to look at your Pending Change Set window, and undo the duplicate items, and then commit the rest.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Valut CommandLine delete local copy after CHECKIN
Did this ever get put in the latest release? If not, can I modifiy the source for the commandline to qadd this? If so, I'll need a little direction.
Thanks, Bob
Thanks, Bob
Re: Valut CommandLine delete local copy after CHECKIN
It's not possible to change how our CLC works, but you could write something with our client API. That can be downloaded from the same location as rest of our downloads: www.sourcegear.com. It is version dependent, so make sure you download the one that matches what you are currently running.
Inside the download is a .chm file with all the documentation. Also, we have a section of the forum devoted to working with the API that has a lot of good examples: http://support.sourcegear.com/viewforum.php?f=39, and a lot of questions already answered.
Inside the download is a .chm file with all the documentation. Also, we have a section of the forum devoted to working with the API that has a lot of good examples: http://support.sourcegear.com/viewforum.php?f=39, and a lot of questions already answered.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Valut CommandLine delete local copy after CHECKIN
I tried to use the api, but getting error "Commit Failed" on line:
ServerOperations.ProcessCommandCheckIn(new string[] { "c:\\test" }, UnchangedHandler.UndoCheckout, false, LocalCopyType.Leave);
The checkout works, but checkin fails. I am using V6.0 apis.
Bob
ServerOperations.ProcessCommandCheckIn(new string[] { "c:\\test" }, UnchangedHandler.UndoCheckout, false, LocalCopyType.Leave);
The checkout works, but checkin fails. I am using V6.0 apis.
Bob
Re: Valut CommandLine delete local copy after CHECKIN
The stacktrace for this is:
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckin(String[] objectPaths, UnchangedHandler unchanged, Boolean keepCheckedOut, LocalCopyType localCopy, Boolean resolveMerge)
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckIn(String[] objectPaths, UnchangedHandler unchanged, Boolean keepCheckedOut, LocalCopyType localCopy)
at Examples.Program.Process(String repositoryFolderPath, String diskPath) in C:\Users\bfeller\documents\visual studio 2010\Projects\SourceGear_Checkin\Program.cs:line 51
at Examples.Program.Main(String[] args) in C:\Users\bfeller\documents\visual studio 2010\Projects\SourceGear_Checkin\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckin(String[] objectPaths, UnchangedHandler unchanged, Boolean keepCheckedOut, LocalCopyType localCopy, Boolean resolveMerge)
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckIn(String[] objectPaths, UnchangedHandler unchanged, Boolean keepCheckedOut, LocalCopyType localCopy)
at Examples.Program.Process(String repositoryFolderPath, String diskPath) in C:\Users\bfeller\documents\visual studio 2010\Projects\SourceGear_Checkin\Program.cs:line 51
at Examples.Program.Main(String[] args) in C:\Users\bfeller\documents\visual studio 2010\Projects\SourceGear_Checkin\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Re: Valut CommandLine delete local copy after CHECKIN
I upgraded my APIs to 6.0.1 and now the checkin works. However I still get that error if I create the folder using the api's then try to checkin:
Error: Commit failed
Code:
ServerOperations.client.AutoCommit = true;
ServerOperations.ProcessCommandCreateFolder(repositoryFolderPath)
ServerOperations.ProcessCommandCheckIn(new string[] { diskPath }, UnchangedHandler.UndoCheckout, bKeepCheckedOut, LocalCopyType.Delete);
Error: Commit failed
Code:
ServerOperations.client.AutoCommit = true;
ServerOperations.ProcessCommandCreateFolder(repositoryFolderPath)
ServerOperations.ProcessCommandCheckIn(new string[] { diskPath }, UnchangedHandler.UndoCheckout, bKeepCheckedOut, LocalCopyType.Delete);
Re: Valut CommandLine delete local copy after CHECKIN
Are you creating a folder and doing a checkin in the same transaction? They may need to be two different transactions.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: Valut CommandLine delete local copy after CHECKIN
Yes I am. I will move it to another process.
Thank you
Thank you
Re: Valut CommandLine delete local copy after CHECKIN
How would I code 2 transactions? Do I need to cretae thhe folder, logout, login, and will that start a new transaction for me?
I'll try it, see what happens.
I'll try it, see what happens.
Re: Valut CommandLine delete local copy after CHECKIN
Not sure if you need to logout and log in again. But you would need to commit one transaction first, then create the next transaction and commit it.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager