Page 1 of 1
Checkin command not working...
Posted: Wed Apr 23, 2008 9:45 am
by MattTrinder
Hi
I am trying to check in a modified file with the following command...
ServerOperations.ProcessCommandCheckIn( new string[] { filePath }, UnchangedHandler.UndoCheckout , false, LocalCopyType.Leave );
However the result is always that the file is Unchecked out rather than the modified version being checked in.
I have tried using both the vault path and the modified file disk path with the same result - what am I doing wrong...?
Matt
Posted: Wed Apr 23, 2008 9:54 am
by shannon
If you look at the file in the gui client (before you run your code, when it is modified) what is the status shown there?
Posted: Wed Apr 23, 2008 10:03 am
by MattTrinder
It is showing as Edited
Posted: Wed Apr 23, 2008 12:07 pm
by shannon
So the file just keeps a status of Edited but is no longer checked out?
Are you using the same login in the code that you used for the gui client?
Posted: Thu Apr 24, 2008 2:37 am
by MattTrinder
No, the edited status disappears and it remains at the same version number - exactly the same behaviour you would get if you undid the checkout.
Versions
VaultClientIntegrationLib 4.0.6.15954
Server 4.0.5.15922
Posted: Thu Apr 24, 2008 8:24 am
by shannon
Can you either post or email me the code for what you are doing before and after you call ProcessCommandCheckin?
Posted: Fri Apr 25, 2008 2:36 am
by MattTrinder
I am using this to check out the file...
Code: Select all
GetOptions go = new GetOptions();
go.Merge = MergeType.AttemptAutomaticMerge ;
go.MakeWritable = MakeWritableType.MakeAllFilesWritable ;
go.SetFileTime = SetFileTimeType.Current;
ServerOperations.ProcessCommandCheckout(new string[] { filePath } , true, true, go);
and then this to check it back in again...
Code: Select all
ServerOperations.ProcessCommandCheckIn( new string[] { filePath }, UnchangedHandler.UndoCheckout , false, LocalCopyType.Replace );
I am not calling anything else after the CheckIn - do I need to...?
Posted: Fri Apr 25, 2008 2:37 am
by MattTrinder
I also get exactly the same result after having upgraded the server and the API to 4.1
Posted: Fri Apr 25, 2008 8:34 am
by shannon
I think this is related to another problem we've seen with calling checkout immediately before checkin.
Try inserting this line inbetween the two calls:
ServerOperations.ProcessCommandListChangeSet(new string[] { filePath });
Meanwhile, I will keep looking into the cause.
Posted: Fri Apr 25, 2008 8:56 am
by MattTrinder
That solved the problem, thanks.
Last question for the moment - how do I add a checkin comment as part of the ProcessCommandCommit call...?
Thanks
Matt
Posted: Fri Apr 25, 2008 8:59 am
by shannon
set ServerOperations.client.Comment
Make sure you reset it after commit though, because it won't reset on it's own.
Posted: Fri May 30, 2008 3:28 pm
by jeremy_sg
Vault 4.1.2 now handles calling ProcessCommandCheckin directly after calling ProcessCommandCheckout.