I am doing a search on history items based on a specific search criterion. I want to be able to check if the version of the files found in the search is the latest version of the file or not.
I have the following code so far:
VaultLib.VaultHistoryItem[] items = new VaultLib.VaultHistoryItem[1];
_myClient.Connection.HistoryBegin(req, 100, ref rowsRetrieved, ref token);
if (rowsRetrieved > 0)
{
_myClient.Connection.HistoryFetch(token, 0, rowsRetrieved - 1, ref items);
}
_myClient.Connection.HistoryEnd(token);
foreach (VaultLib.VaultHistoryItem item in items)
{
newItem = new VaultVDDItem(fileName,version);
myList.Add(newItem);
fileName = item.Name;
version = (int)item.Version;
// VaultClientFolder searchFolder = _myClient.Repository.Root.FindFolderRecursive(VDDConstants.VaultFolder);
// VaultClientFile file = new VaultClientFile();
// RecursivelySearchForFileName(searchFolder,fileName,ref file);
// VaultFileProperties v = _myClient.GetFileProperties(item.Name,file.ObjVerID);
}
The stuff in comments i tried, but was not able to get it to work properly. Please advise.
Thanks
haider
Check for latest version
Moderator: SourceGear
-
- Posts: 34
- Joined: Wed Jun 15, 2005 2:07 pm
Well i see how you can check the objID and if they match, then that means i have the latest version in the history item. However, that requires a recursive search which takes time off the clock. I want to use this function:
VaultFileProperties v = _myClient.GetFileProperties(fileName.Substring(fileName.LastIndexOf("/")+1),item.ObjVerID);
because VaultFileProperties has a .LatestVersion property which i assume is what i am looking for. However, when i pass the ObjVerID of the history item into the second parameter, i get the following error:
System.Web.Services.Protocols.SoapException: 1206 : FailObjPathInvalid
What values am i supposed to pass into the second parameter to achieve my objective.
Thanks a lot jeremy
VaultFileProperties v = _myClient.GetFileProperties(fileName.Substring(fileName.LastIndexOf("/")+1),item.ObjVerID);
because VaultFileProperties has a .LatestVersion property which i assume is what i am looking for. However, when i pass the ObjVerID of the history item into the second parameter, i get the following error:
System.Web.Services.Protocols.SoapException: 1206 : FailObjPathInvalid
What values am i supposed to pass into the second parameter to achieve my objective.
Thanks a lot jeremy
-
- Posts: 34
- Joined: Wed Jun 15, 2005 2:07 pm