Hi, could someone please point me to an example of a file rollback with the API?
Many thanks,
Ben
Rollback
Moderator: SourceGear
Re: Rollback
The latest and greatest (4.1.4, I think).
Re: Rollback
Never mind...I found the class I was looking for: ChangeSetItem_Rollback. Should work fine...
Re: Rollback
Actually, I could use some explanation of the parameters into the constructor of this class. Is there a help document that describes these parameters?
ChangeSetItem_Rollback(VaultLib.VaultDateTime time, string comment, string properties, long ObjVerID, string repositoryPath)
Ben
ChangeSetItem_Rollback(VaultLib.VaultDateTime time, string comment, string properties, long ObjVerID, string repositoryPath)
Ben
Re: Rollback
The first three parameters are standard for all types of change set items: the time is the time the action (rollback, in this instance) occurred - usually VaultDateTime.Now, the comment is the change set item comment (pass an empty string to omit), the properties string is used by us for extra info about the file - you should set it to empty string. The ObjVerId is the ObjVerId to rollback to. The repositorypath is the full repository path of the object.
using VaultHistoryItem vhi, you could make it like this:
ChangeSetItem_Rollback csir = new ChangeSetItem_Rollback(VaultDateTime.Now, String.Empty, String.Empty, vhi.ObjVerID, vhi.Name);
using VaultHistoryItem vhi, you could make it like this:
ChangeSetItem_Rollback csir = new ChangeSetItem_Rollback(VaultDateTime.Now, String.Empty, String.Empty, vhi.ObjVerID, vhi.Name);