Vault 3.1.7 CLC or API: how to get changeset comment
Moderator: SourceGear
Vault 3.1.7 CLC or API: how to get changeset comment
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.
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.
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.
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
SourceGear
Technical Support Manager
So there is no way using Client API to get "Folder History by Version"?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.
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?
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.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?
Jeff Clausius
SourceGear
SourceGear
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"jclausius wrote:This would be the way to retrieve all information about a given changeset.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?
Are you implying that using the ProcessCommandVersionHistory is more efficient?
No.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"
Are you implying that using the ProcessCommandVersionHistory is more efficient?
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
SourceGear
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.
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.