retrieving label or comment from a file

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
bermudabob
Posts: 10
Joined: Fri May 28, 2010 3:09 am

retrieving label or comment from a file

Post by bermudabob » Thu Sep 09, 2010 5:32 am

I need to be able to set either a label or a comment for a file and then be able to retrieve it again at a later date.

Currently, I can set a label and I can set a comment, but I'm have a job figuring out how to retrieve them. is there any way to get a label or a comment associated with a version of a file? I've looked at the available properties in the VaultClientFile object and also GetFileProperties, but no label info seems there, and the comment field always seems to be blank, no matter what I set it to.

Rob

bermudabob
Posts: 10
Joined: Fri May 28, 2010 3:09 am

Re: retrieving label or comment from a file

Post by bermudabob » Thu Sep 09, 2010 8:47 am

I've done some more digging, and found how to get the information I need using ProcessCommandHistory. The only stumbling block I've got now is that while I can create a label, I need to be able to create a comment to go with it. Not having much success in finding how to do this...

bermudabob
Posts: 10
Joined: Fri May 28, 2010 3:09 am

Re: retrieving label or comment from a file

Post by bermudabob » Thu Sep 09, 2010 9:23 am

Looks like I've managed to find out how to do this myself - for information purposes, here's what I did:

I set the 'ServerOperations.client.Comment' field to the comment I wanted and then did the 'ServerOperations.ProcessCommandLabel' method. Lo and behold, the comment field was set. It also works for other operations such as Check in and Check out.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: retrieving label or comment from a file

Post by Beth » Thu Sep 09, 2010 1:35 pm

Thank you for posting what you found. This should help other users as well.
Beth Kieler
SourceGear Technical Support

Post Reply