HistItemType reference?

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

Moderator: SourceGear


Posts: 8
Joined: Mon Nov 23, 2015 4:05 am
PostPosted: Mon Nov 23, 2015 9:31 am
Are the possible values for HistItemType in VaultHistoryItem (and other fields) found by calling ServerOperations.ProcessCommandHistoryEx() listed anywhere? I'm trying to use this list but I'm not sure what the values are supposed to mean.

HistItemType
10 = Add Child (MiscInfo1 has name of child, Name is a folder of course (type 1))
20 = ? possible move ? (MiscInfo1 has old full path, MiscInfo2 has new full path?)
30 = Share? See txid 13620;;
60 = Modify
70 = Add
80 = Delete Child (MiscInfo1 has name)
90 = Label (TxId is 0, MiscInfo1 has label text)
170 = Rename?

Posts: 8418
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Mon Nov 23, 2015 1:30 pm
If you are looking to view history, then this should provide you with what you need.

//Query the file history so we can view the check in.
bool bRecursive = false;
int beginVersion = -1;
int endVersion = -1;
VaultHistoryItem[] items = ServerOperations.ProcessCommandHistory(filePath, bRecursive, DateSortOption.desc, null, null, VaultDate.EmptyDate().ToString(), VaultDate.EmptyDate().ToString(), null, null, beginVersion, endVersion, 10);

// output the history items
xml.WriteStartElement("root");

xml.WriteStartElement("History");
XmlHelper.XmlOutput(xml, items);
xml.WriteEndElement();

If you're looking to do something else, they please describe further.
Beth Kieler
SourceGear Technical Support

Posts: 8
Joined: Mon Nov 23, 2015 4:05 am
PostPosted: Mon Nov 23, 2015 5:19 pm
Thanks for the quick response. That's the method I'm using, I just don't know what the values mean in the HistItemType field in the results. I think I know what those ones above mean, but I also see there are some history items with HistItemType values of 40, 120, 130, 150, 160, 180, 190, 220 and 230 and I have no clue what those mean.

I am hoping to be able to replay history of what happened in Vault. We are going through and checking to see if any passwords were inadvertently checked it and might re-create history for a project in a new folder with those passwords and keys removed in preparation for making the source code (and history) for our project more widely available. We may also want to remove some shared folders as they are their own projects and can be gotten separately.

I though about using ProcessCommandVersionHistory() and walking through the distinct versions of the main folder, then using ProcessCommandGetBranchStructure() for each version and manually figuring out what has changed and doing the appropriate change and checking in if there are any changes (I might ignore a version if there are changes only in a shared subfolder I don't care about). If I can just figure out what all those values are, I think ProcessCommandHistory() will be what I need though. I can just walk through that history and do each thing (add this file, delete this file, etc) and ignore it if the Name is in a subdirectory I want to ignore.

Posts: 3480
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Tue Nov 24, 2015 9:03 am
jgoemat wrote:Thanks for the quick response. That's the method I'm using, I just don't know what the values mean in the HistItemType field in the results. I think I know what those ones above mean, but I also see there are some history items with HistItemType values of 40, 120, 130, 150, 160, 180, 190, 220 and 230 and I have no clue what those mean.

Check the VaultLib.VaultHistoryType members or use VaultHistoryType.GetHistoryTypeName(int) to convert the history types to their English strings.
Jeff Clausius
SourceGear

Posts: 8
Joined: Mon Nov 23, 2015 4:05 am
PostPosted: Tue Nov 24, 2015 9:49 am
jclausius wrote:Check the VaultLib.VaultHistoryType members or use VaultHistoryType.GetHistoryTypeName(int) to convert the history types to their English strings.


EXACTLY what I was looking for (except it doesn't have type 230 which I'll ignore, using Vault 6.1), thanks!

Posts: 3480
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Tue Nov 24, 2015 11:28 am
If you can browse VaultLib's VaultHistoryType, it should list all types by property. In any case, I believe 230 may be Rollback.
Jeff Clausius
SourceGear

Return to Questions (API)

Who is online

Users browsing this forum: No registered users and 2 guests