Vault 3.1.7 CLC or API: how to get changeset comment

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Vault 3.1.7 CLC or API: how to get changeset comment

Post by ismangil » Thu Aug 03, 2006 7:36 am

We've got some specific comment format that is used for reporting. However, due to spurious checkin strangeness, some users checkin comment are not shown in history list comment either through GUI, CLC, or API history command.

If in the GUI we go to Changeset Comment then we found the comment we want.

How do we easily do a history query that includes these changeset comments. API solution preferable because we intend to do other stuff like check for labels etc, but we can live with CLC xml history and parse that.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Thu Aug 03, 2006 12:20 pm

Here's some information about where comments are found in history:

http://support.sourcegear.com/viewtopic.php?t=4303

In the command line, the History command returns only one comment -- the item comment or, if there is no item comment, it returns the changeset comment, but not both.

This would be the same for the Client API.
Linda Bauer
SourceGear
Technical Support Manager

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Thu Aug 03, 2006 4:41 pm

lbauer wrote:Here's some information about where comments are found in history:

http://support.sourcegear.com/viewtopic.php?t=4303

In the command line, the History command returns only one comment -- the item comment or, if there is no item comment, it returns the changeset comment, but not both.

This would be the same for the Client API.
So there is no way using Client API to get "Folder History by Version"?

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Fri Aug 04, 2006 2:42 am

Another way I may have found is through TxDetails:

myClient.Connection.GetTxDetail(myClient.ActiveRepositoryID, vhi.TxID, ref changesetComment, ref vtdhitems);

So after I found the history items, instead of getting comments from VaultHistoryItem, I use the TxID to get TxDetails instead.

It seems to work, just needs confirmation that it's a sensible approach?

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Aug 04, 2006 8:06 am

ismangil wrote:So there is no way using Client API to get "Folder History by Version"?
Did you look at myClient.Connection..VersionHistoryXYZ()?

The Client API has an entire method for ProcessCommandVersionHistory() which may help.
Jeff Clausius
SourceGear

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Aug 04, 2006 8:06 am

ismangil wrote:Another way I may have found is through TxDetails:

myClient.Connection.GetTxDetail(myClient.ActiveRepositoryID, vhi.TxID, ref changesetComment, ref vtdhitems);

So after I found the history items, instead of getting comments from VaultHistoryItem, I use the TxID to get TxDetails instead.

It seems to work, just needs confirmation that it's a sensible approach?
This would be the way to retrieve all information about a given changeset.
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Fri Aug 04, 2006 8:14 am

jclausius wrote:
ismangil wrote:Another way I may have found is through TxDetails:

myClient.Connection.GetTxDetail(myClient.ActiveRepositoryID, vhi.TxID, ref changesetComment, ref vtdhitems);

So after I found the history items, instead of getting comments from VaultHistoryItem, I use the TxID to get TxDetails instead.

It seems to work, just needs confirmation that it's a sensible approach?
This would be the way to retrieve all information about a given changeset.
Thanks Jeff. Just for clarification though, your reply seems a bit flat in the sense of "Yeah that works but that sucks but you could do it that way if you really want to" :D

Are you implying that using the ProcessCommandVersionHistory is more efficient?

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Aug 04, 2006 8:49 am

ismangil wrote:Thanks Jeff. Just for clarification though, your reply seems a bit flat in the sense of "Yeah that works but that sucks but you could do it that way if you really want to" :D

Are you implying that using the ProcessCommandVersionHistory is more efficient?
No.

I'm not sure history will retrieve exactly what you want.

In history, if a changeset item comment was entered, then that is displayed in the comment of the history item. If there is no changesetitem comment, then the changeset comment is displayed. So in the case of a big changeset where there are changeset comments as well as changeset item comments, you'll have different comments for the results of the history query.

I think you would want finer control, so getting the changeset (transaction) details would want to use.
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Fri Aug 04, 2006 9:21 am

Good.

As a background this problem stems from the fact the we never use item comments, and in the few times it's set is because programmer error when using Visual Studio integration (it displays a 'checkout comment' box, invariable some junk gets typed in there).

The 'proper' comment then is typed using the "Pending Checkin" tab, which is interpreted as changeset comment. So I'm fairly happy now that I can get the changeset comment, it has already identified a few more files that we miss because 'normal' VaultHistoryItem only contains item comments.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Aug 04, 2006 9:28 am

Sounds like you have a plan of attack for coding this. Good Luck.
Jeff Clausius
SourceGear

Locked