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...