Page 1 of 1
Get local version value
Posted: Mon Sep 27, 2010 1:51 pm
by smartbear
I have a local file at version 3, and the repository version is 4 having been rolled back to 2. Viewing the folder with the Vault GUI client shows that file with Local Version 3 and Remote Version 4, and getting the File Properties also shows Version 3 for the "Local copy" and Version 4 for the "Latest in Repository". How do I find out the local version of the file is 3? FindVaultTreeObjectAtReposOrLocalPath or FindVaultFileAtReposOrLocalPath with the local filename both return the repository version of the file.
Thanks,
Eric
Re: Get local version value
Posted: Mon Sep 27, 2010 3:44 pm
by Beth
You could try to check the version of the VaultClientFile from ClientInstance.TreeCache.Repository.Root.FindFileRecursive($/A/B/.../file).
Re: Get local version value
Posted: Thu Oct 07, 2010 10:16 am
by smartbear
It didn't work - returns the same item as RepositoryUtil.FindVaultFileAtReposOrLocalPath(path), and has the repository version of the file, not the local version. Can you find out how the Vault client determines the local version?
Re: Get local version value
Posted: Thu Oct 07, 2010 1:22 pm
by Beth
What happens if you try something like the following?
Using the VaultClientFile's parent folder to get a working folder:
VaultClientFile f = ... <some file> ...; if ((f != null) && (f.Parent != null)) {
WorkingFolder wf = ClientInstace.TreeCache.GetBestWorkingFolder(f.Parent);
if (wf != null)
long nLocalVersion = wf.GetBaselineVersion(f); }