GetRepositoryAt not working?
Posted: Mon Nov 30, 2015 1:05 pm
I'm trying to use Client.GetRepositoryAt(txid) to get the way the repository looked at a certain version but it isn't working for my repository. I created a new repository and moved some folders around to get 5 versions and it seemed to work fine for it:
This prints 1 and 5 correctly for the test repository. When I run it on my work repository however with transactions from the history, it always returns the last updated version of root. Here are the last version and txid for the history of '$':
Version 14944 TxId 14998
Version 15256 TxId 15310
Version 18047 TxId 18101
Version 1 TxId 18500
Version 18446 TxId 18500
Version 18447 TxId 18501
Version 22888 TxId 22942
Version 24262 TxId 24316
Version 24400 TxId 24454
Version 25131 TxId 25185
Version 25197 TxId 25251
Version 25275 TxId 25329
Version 25701 TxId 25755
Version 27279 TxId 27333
No matter what I pass as TxId, I always get back root version 27332:
TxID: 1424 is Version 27332
TxID: 12685 is Version 27332
TxID: 18047 is Version 27332
TxID: 18446 is Version 27332
TxID: 25755 is Version 27332
TxID: 27333 is Version 27332
TxID 18500 seems to be adding a file to the root. Is that screwing it up somehow or am I doing something else wrong?
Code: Select all
var rep = ServerOperations.client.ClientInstance.GetRepositoryAt(37365); // version 1
Console.WriteLine("Version (should be 1): {0}", rep.Root.Version);
rep = ServerOperations.client.ClientInstance.GetRepositoryAt(37369); // version 5
Console.WriteLine("Version (should be 5): {0}", rep.Root.Version);
Version 14944 TxId 14998
Version 15256 TxId 15310
Version 18047 TxId 18101
Version 1 TxId 18500
Version 18446 TxId 18500
Version 18447 TxId 18501
Version 22888 TxId 22942
Version 24262 TxId 24316
Version 24400 TxId 24454
Version 25131 TxId 25185
Version 25197 TxId 25251
Version 25275 TxId 25329
Version 25701 TxId 25755
Version 27279 TxId 27333
No matter what I pass as TxId, I always get back root version 27332:
Code: Select all
foreach (long txId in new long[] { 1424, 12685, 18047, 18446, 25755, 27333})
{
var rep = ServerOperations.client.ClientInstance.GetRepositoryAt(txId);
Console.WriteLine("TxID: {0} is Version {1}", txId, rep.Root.Version);
}
TxID: 1424 is Version 27332
TxID: 12685 is Version 27332
TxID: 18047 is Version 27332
TxID: 18446 is Version 27332
TxID: 25755 is Version 27332
TxID: 27333 is Version 27332
TxID 18500 seems to be adding a file to the root. Is that screwing it up somehow or am I doing something else wrong?