DetectModifiedFilesWithCRCs

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

DetectModifiedFilesWithCRCs

Post by MattTrinder » Mon May 12, 2008 9:09 am

How do I set this using the API so that my API app does not check in files
with unmodified contents ?

I am using ServerOperations.ProcessCommandCheckIn and Checkout, and it appears that WFO are a property of the client instance... Am I missing something about how these two are related...?


Cheers

Matt

shannon

Post by shannon » Mon May 12, 2008 9:49 am

Try setting the UnchangedHandler to UndoCheckout when you call ProcessCommandCheckin.

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

Post by MattTrinder » Mon May 12, 2008 9:56 am

Am already doing that :(

Due to the way this system works, it is actually re-writing the file in question with an exact copy of itself. So the contents have not changed but the file date has.

With the CRC option set in the Vault client, a checkin of this file results in an UndoCheckout as expected - I need to duplicate this behaviour using the API.

I have created a new

Code: Select all

_wfo = new WorkingFolderOptions(true, LocalCopyType.Replace, MakeWritableType.MakeAllFilesReadOnly, false, false, 0, true, 10);
with the true option set to use CRC checks, and am passing this as follows before both the CheckIn and Checkout operations.

Code: Select all

ServerOperations.client.ClientInstance.WorkingFolderOptions = _wfo;
but am still getting a checkin rather than an UndoCheckout.

Thanks

Matt

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

Post by MattTrinder » Mon May 12, 2008 10:00 am

Got It.

Code: Select all

ServerOperations.client.ClientInstance.WorkingFolderOptions.DetectModifiedFilesWithCRCs = true;
before checkout and checkin seems to do the trick.

shannon

Post by shannon » Mon May 12, 2008 10:22 am

Glad to hear it. If you don't plan to change that setting (or any others you find you need) you can always open the gui client on that machine and log in as the user your app is using and set them there instead of in code. The api and clc should share the same settings.

Post Reply