GetByDisplayVersion API call doesn't use baseline file.
Moderator: SourceGear
GetByDisplayVersion API call doesn't use baseline file.
Hello,
I have a custom client that is using the vault API.
I have specified that baseline files should be stored in the working folders.
(I have done this programatically using ClientInstance.WorkingFolderOptions.StoreDataInWorkingFolders = True)
If I call the .Get method to get a file for the first time, the client downloads the file (and creates the baseline file in the hidden _sgvault folder). When I call .Get a second time for the same file, no file is downloaded, instead the baseline file is copied and renamed in the working folder. This is the correct behavior.
If I try to get prior versions of a file by using the .GetByDisplayVersion method, I am finding that it downloads the file every time - even though the first time seems to correctly create the baseline file.
I notice that if I use the VaultGUI client to get prior versions of the file, it appropriately uses the cached baselines. What am I doing wrong in my use of the API? What do I need to do programatically to make use of the caching?
Thank you,
Dave
I have a custom client that is using the vault API.
I have specified that baseline files should be stored in the working folders.
(I have done this programatically using ClientInstance.WorkingFolderOptions.StoreDataInWorkingFolders = True)
If I call the .Get method to get a file for the first time, the client downloads the file (and creates the baseline file in the hidden _sgvault folder). When I call .Get a second time for the same file, no file is downloaded, instead the baseline file is copied and renamed in the working folder. This is the correct behavior.
If I try to get prior versions of a file by using the .GetByDisplayVersion method, I am finding that it downloads the file every time - even though the first time seems to correctly create the baseline file.
I notice that if I use the VaultGUI client to get prior versions of the file, it appropriately uses the cached baselines. What am I doing wrong in my use of the API? What do I need to do programatically to make use of the caching?
Thank you,
Dave
Take a look at http://support.sourcegear.com/viewtopic.php?t=4172 for info on how to get a historical version without having to resort to getbydisplayversion. I'm assuming that you have run a history query which returns the objverid of the version you need to download.
I'm a little confused by your reply. The thread that you sent me to suggests using GetByDisplayVersionToNonWorkingFolder.
Yes, I have a history query, so I have the ObjVerID.
Are you suggesting that I can set the objverid property of the file (as opposed to just the display version) and that this will correctly use the cache, even if I am calling one of the NonWorkingFolder methods?
Yes, I have a history query, so I have the ObjVerID.
Are you suggesting that I can set the objverid property of the file (as opposed to just the display version) and that this will correctly use the cache, even if I am calling one of the NonWorkingFolder methods?
Jeremy,
Thanks for your help. I now have my client making use of the cache correctly. In the cases where I don't already have the objverid from a prior history query, I am performing a history query at that point to determine it. This doesn't take long, and the performance I pick up from the cache outweighs the time to lookup the objverid.
Thanks,
Dave
Thanks for your help. I now have my client making use of the cache correctly. In the cases where I don't already have the objverid from a prior history query, I am performing a history query at that point to determine it. This doesn't take long, and the performance I pick up from the cache outweighs the time to lookup the objverid.
Thanks,
Dave