How Do I Determine an Item's Index for UndoChangeSetItem?
Posted: Wed Oct 21, 2009 11:11 am
I'm trying to create a revert command: I want to be able to undo all pending additions, deletions, and modifications at any point in my repository tree without affecting any changes outside that part of the tree.
For example, if my tree looks like this:
I would like to revert any pending changes at $/Current/Production/Database, but leave all other changes in place.
The closest command I found to accomplish this is ProcessCommandUndoChangeSetItem(int changeSetItemId). I'm having trouble figuring out what to use for the value of the changeSetItemId.
I've called ProcessCommandListChangeSet on the path I want to revert, but the collection of items I get back don't have any properties that seem to map to the change set item ID.
It appears this ID is an index (zero-based) into the list of all pending changes in a repository. So, I tried calling ProcessCommandListChangeSet(new [] { "$" }), but that took 10 or 15 minutes to complete.
What is the best way to accomplish what I want?
For example, if my tree looks like this:
Code: Select all
$
Current
Production
Database
Web
The closest command I found to accomplish this is ProcessCommandUndoChangeSetItem(int changeSetItemId). I'm having trouble figuring out what to use for the value of the changeSetItemId.
I've called ProcessCommandListChangeSet on the path I want to revert, but the collection of items I get back don't have any properties that seem to map to the change set item ID.
It appears this ID is an index (zero-based) into the list of all pending changes in a repository. So, I tried calling ProcessCommandListChangeSet(new [] { "$" }), but that took 10 or 15 minutes to complete.
What is the best way to accomplish what I want?