Valut CommandLine delete local copy after CHECKIN

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Wed May 23, 2012 11:48 am

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.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Valut CommandLine delete local copy after CHECKIN

Post by lbauer » Wed May 23, 2012 3:51 pm

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.
Linda Bauer
SourceGear
Technical Support Manager

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Mon Jun 04, 2012 11:48 am

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

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Valut CommandLine delete local copy after CHECKIN

Post by Beth » Mon Jun 04, 2012 12:58 pm

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.
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.
I'm not sure I'm understanding the question. Is there a reason to not continue using Powershell for your XML parsing?
Beth Kieler
SourceGear Technical Support

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Tue Jun 05, 2012 8:13 am

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

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Valut CommandLine delete local copy after CHECKIN

Post by Beth » Tue Jun 05, 2012 12:32 pm

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.
Beth Kieler
SourceGear Technical Support

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Wed Oct 10, 2012 9:41 am

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

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Valut CommandLine delete local copy after CHECKIN

Post by Beth » Wed Oct 10, 2012 10:07 am

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.
Beth Kieler
SourceGear Technical Support

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Wed Oct 10, 2012 11:19 am

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

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Wed Oct 10, 2012 11:31 am

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()

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Wed Oct 10, 2012 4:26 pm

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);

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Valut CommandLine delete local copy after CHECKIN

Post by lbauer » Thu Oct 11, 2012 3:04 pm

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

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Fri Oct 12, 2012 8:03 am

Yes I am. I will move it to another process.

Thank you

bfeller
Posts: 20
Joined: Fri May 18, 2012 9:07 am

Re: Valut CommandLine delete local copy after CHECKIN

Post by bfeller » Tue Oct 16, 2012 8:33 pm

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.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Valut CommandLine delete local copy after CHECKIN

Post by lbauer » Thu Oct 18, 2012 10:53 am

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

Post Reply