Re: How to get just a changeset
Posted: Fri Nov 27, 2015 1:40 pm
First here is what might be an easy way, but I haven't tried it. You can get the repository as of a certain txid and find the VaultClientFile from there:robe070 wrote:I don't actually need to find the file. I know its there at Version 1 because the history told me. I just need to be able to construct a VaultClientFile object for this version of the file. Then I would expect it to be able to return me the actual file from the Server. Its highly unlikely the file is in the cache, because its a very old version of the tree. I have to get it from the server.
I've got all the txn details from the history. Can that be used to construct a VaultClientFile? There isn't a constructor that can do it that I can see. And the elements I think I need to set are read-only.
Those APIs you listed. How do I specify to search for a Version of a File? They all seem to work on the latest view of the repository. This is the critical thing. FindFileRecursive will not find the file. But if I find something existing and set the Version correctly it will retrieve it as the contents of that folder. But I actually only know the verson at $ and the version of the file. I do not know the version of the parent folders so I can't use them.
What if the folder has also been removed in the latest view?
If I can just construct a VaultClientFile object for this file.
Code: Select all
var rep = ServerOperations.client.ClientInstance.GetRepositoryAt(txid);
var clientFile = rep.Root.FindFileRecursive(id);
Code: Select all
VaultClientFolder vcFolder = RepositoryUtil.FindVaultTreeObjectAtReposOrLocalPath(vaultPath) as VaultClientFolder;
VaultFolderDelta delta = ServerOperations.ProcessCommandGetBranchStructure(repId, vaultPath, vcFolder.ID, version, false);
vcFolder = new VaultClientFolder(delta, vcFolder.Parent);