Checkin command not working...

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

Moderator: SourceGear

Post Reply
MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Checkin command not working...

Post by MattTrinder » Wed Apr 23, 2008 9:45 am

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

shannon

Post by shannon » Wed Apr 23, 2008 9:54 am

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?

MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Post by MattTrinder » Wed Apr 23, 2008 10:03 am

It is showing as Edited

shannon

Post by shannon » Wed Apr 23, 2008 12:07 pm

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?

MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Post by MattTrinder » Thu Apr 24, 2008 2:37 am

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

shannon

Post by shannon » Thu Apr 24, 2008 8:24 am

Can you either post or email me the code for what you are doing before and after you call ProcessCommandCheckin?

MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Post by MattTrinder » Fri Apr 25, 2008 2:36 am

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...?

MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Post by MattTrinder » Fri Apr 25, 2008 2:37 am

I also get exactly the same result after having upgraded the server and the API to 4.1

shannon

Post by shannon » Fri Apr 25, 2008 8:34 am

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.

MattTrinder
Posts: 24
Joined: Tue Feb 12, 2008 8:07 am

Post by MattTrinder » Fri Apr 25, 2008 8:56 am

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

shannon

Post by shannon » Fri Apr 25, 2008 8:59 am

set ServerOperations.client.Comment

Make sure you reset it after commit though, because it won't reset on it's own.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Fri May 30, 2008 3:28 pm

Vault 4.1.2 now handles calling ProcessCommandCheckin directly after calling ProcessCommandCheckout.
Subscribe to the Fortress/Vault blog

Post Reply