ProcessCommandUndoChangeSetItem
Posted: Tue Nov 24, 2015 4:14 pm
I'm writing tests as I learn to use vault and to understand exactly what the api calls do and I can't get this one to work reliably. Here I create two folders which puts them into a Pending Change Set in the client:
So far so good. Now I want to try removing those pending changes, but I get an error:
The error I get is (on the FIRST item, index 0):
"Invalid ChangeSetItem ID: 0. Please use the LISTCHANGESET command to retrieve a valid ID."
I saw this topic as I was using a path before and changed it to null as you can see above. It says the index is a global index into all pending changes, so I'm wondering also if calling it for 0 would mean the next item would be 0 the next time? Should I go through the list in reverse?
Also I deleted the pending changes in the vault GUI, then I committed the folders after creating them in code and deleted the folders using the vault GUI to try again. Now I'm getting "Object reference not set to an instance of an object." trying to create the folder again...
Code: Select all
ServerOperations.ProcessCommandCreateFolder("$/VaultWrapper.Tests");
ServerOperations.ProcessCommandCreateFolder("$/Test2/New1");
So far so good. Now I want to try removing those pending changes, but I get an error:
Code: Select all
ChangeSetItemColl result;
var changeSet = ServerOperations.ProcessCommandListChangeSet(null);
for (int i = 0; i < changeSet.Count; i++)
{
var item = changeSet[i];
ServerOperations.ProcessCommandUndoChangeSetItem(i);
}
"Invalid ChangeSetItem ID: 0. Please use the LISTCHANGESET command to retrieve a valid ID."
I saw this topic as I was using a path before and changed it to null as you can see above. It says the index is a global index into all pending changes, so I'm wondering also if calling it for 0 would mean the next item would be 0 the next time? Should I go through the list in reverse?
Also I deleted the pending changes in the vault GUI, then I committed the folders after creating them in code and deleted the folders using the vault GUI to try again. Now I'm getting "Object reference not set to an instance of an object." trying to create the folder again...