Rollback

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Rollback

Post by ben » Fri Jan 16, 2009 12:55 pm

Hi, could someone please point me to an example of a file rollback with the API?
Many thanks,
Ben

shannon

Re: Rollback

Post by shannon » Fri Jan 16, 2009 1:22 pm

What version are you using?

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: Rollback

Post by ben » Fri Jan 16, 2009 10:10 pm

The latest and greatest (4.1.4, I think).

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: Rollback

Post by ben » Sat Jan 17, 2009 9:13 pm

Never mind...I found the class I was looking for: ChangeSetItem_Rollback. Should work fine...

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: Rollback

Post by ben » Sat Jan 17, 2009 9:23 pm

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

shannon

Re: Rollback

Post by shannon » Mon Jan 19, 2009 8:11 am

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);

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: Rollback

Post by ben » Mon Jan 19, 2009 10:03 pm

Great, thanks.

Post Reply