I am writing a system which will script a sql database and then check the scripts into Vault. This is using the Client API.
I am having a problem with the check in stage. As the database is scripted out each time, the file create/modify dates will change, even if the content of each file is the same.
I want to use the WorkingFolder.IsModified method to compare via CRC, rather than file date time, however this is always returning true even when the contents of the files is identical.
How can I do a CRC compare rather than a file/date time compare? At the moment whenever I check a file in using ChangeSetItem_Modified, this is incrementing the version even if the files are identical.
WorkingFolder.IsModified using Client API
Moderator: SourceGear
Recent versions of Vault (I think these features were added around 2.0.4, but it may have been 2.0.5) have a class method called IsModified that takes a VaultClientFile or filename as well as an unsigned integer CRC32 value. You can get the input CRC32 value (the one to test against) from the tree cache repository (VaultClientFile.FileCRC). If you call this version of IsModified, only the CRC match is tested (date on file is ignored).
Shaw Terwilliger
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
Thanks for this. I was calling IsModified and just passing in the VaultClientFile.
Now I am passing in the CRC, it is working fine.
Just for the benefit of anyone else reading this, it appears that calling IsModified and just passing in VaultClientFile causes a comparison using LastModifiedDate of the file and passing in a CRC will cause a CRC check. This is not clear in the documentation as it implies all the calls will use a CRC check.
Now I am passing in the CRC, it is working fine.
Just for the benefit of anyone else reading this, it appears that calling IsModified and just passing in VaultClientFile causes a comparison using LastModifiedDate of the file and passing in a CRC will cause a CRC check. This is not clear in the documentation as it implies all the calls will use a CRC check.