Page 1 of 1

HistItemType reference?

Posted: Mon Nov 23, 2015 9:31 am
by jgoemat
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?

Re: HistItemType reference?

Posted: Mon Nov 23, 2015 1:30 pm
by Beth
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.

Re: HistItemType reference?

Posted: Mon Nov 23, 2015 5:19 pm
by jgoemat
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.

Re: HistItemType reference?

Posted: Tue Nov 24, 2015 9:03 am
by jclausius
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.

Re: HistItemType reference?

Posted: Tue Nov 24, 2015 9:49 am
by jgoemat
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!

Re: HistItemType reference?

Posted: Tue Nov 24, 2015 11:28 am
by jclausius
If you can browse VaultLib's VaultHistoryType, it should list all types by property. In any case, I believe 230 may be Rollback.