I Have create a wrapped to handle some of the function call to the vault api.
The wrapper was written in c#.
I have written a small app in delphi which access the vault api throught the c# wrapper that I create.
I'm having problem with the GetLatest procedure.
e.g
In vault I have a filename "File1.txt",
now I rename the file "File1.txt" into "File2.txt"
so now. my local working folder I do not have the file " File2.txt",
now I do a Getlatest to retrieve the file "File2.txt",
now I then CheckOut the "File2.txt"
and the state has become "Need Merge",
the weird thing is. why is this happen. Even thought the file was created.
Even when the file did not exist in teh local working folder.
Is this a bug with the api.?
or I'm not call the GetLatest rite.
here is the code in C# which get teh latest from Vault.
-----------------------------------------------
VaultClientFile LFile = AClient.TreeCache.Repository.Root.FindFileRecursive(AFileName);
AClient.GetToNonWorkingFolder(LFile, true, true, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.Modification, LVaultFolder, ALocalFolder, null);
-----------------------------------------------
GetLatest
Moderator: SourceGear
when I try to used the Get
I get this error message
-------
An unhandled exception of type 'VaultClientOperationsLib.GetLatestVersionFailedException' occurred in vaultclientoperationslib.dll
-------
this is the function I use
-------
private void GetFile(ClientInstance AClient, string ARepositoryPath, string AObjectName)
{
string LTempStr = "";
if(AClient.TreeCache.Repository.Root.FindFileRecursive(ARepositoryPath + FolderTree.PathSeparator + AObjectName) != null)
{
AClient.Refresh();
VaultClientFile LFile = AClient.TreeCache.Repository.Root.FindFileRecursive(ARepositoryPath + FolderTree.PathSeparator + AObjectName);
AClient.Get(LFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.CheckIn, MergeType.OverwriteWorkingCopy, null);
LTempStr = "Getlastest successfully";
}
else
{
LTempStr = "File not found: " + AObjectName + "\n\nPlease verify that this file exists" + " and that the path is correct.";
}
MessageEdit.AppendText(LTempStr + "\n");
}
-------
I get this error message
-------
An unhandled exception of type 'VaultClientOperationsLib.GetLatestVersionFailedException' occurred in vaultclientoperationslib.dll
-------
this is the function I use
-------
private void GetFile(ClientInstance AClient, string ARepositoryPath, string AObjectName)
{
string LTempStr = "";
if(AClient.TreeCache.Repository.Root.FindFileRecursive(ARepositoryPath + FolderTree.PathSeparator + AObjectName) != null)
{
AClient.Refresh();
VaultClientFile LFile = AClient.TreeCache.Repository.Root.FindFileRecursive(ARepositoryPath + FolderTree.PathSeparator + AObjectName);
AClient.Get(LFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.CheckIn, MergeType.OverwriteWorkingCopy, null);
LTempStr = "Getlastest successfully";
}
else
{
LTempStr = "File not found: " + AObjectName + "\n\nPlease verify that this file exists" + " and that the path is correct.";
}
MessageEdit.AppendText(LTempStr + "\n");
}
-------