Challenge with history listing
Moderator: SourceGear
Challenge with history listing
I'm attempting to retrieve a list of all items checked in as of a date range and am not getting back all results.
ServerOperations.client.LoginOptions.URL = "http://devsrv";
ServerOperations.client.LoginOptions.User = "user";
ServerOperations.client.LoginOptions.Password = "pass";
ServerOperations.client.LoginOptions.Repository = "dev-rep";
ServerOperations.client.AutoCommit = true;
ServerOperations.client.Verbose = true;
ServerOperations.client.LoginOptions.AccessLevel = VaultClientNetLib.VaultConnection.AccessLevelType.Admin;
ServerOperations.Login();
string filePath = "$/filepath";
StringWriter sw = new StringWriter();
System.Xml.XmlTextWriter xml = new XmlTextWriter(sw);
xml.Formatting = System.Xml.Formatting.Indented;
//Query the file history so we can view the check in.
bool bRecursive = false;
int beginVersion = -1;
int endVersion = -1;
string excludedList = "add,create,label";
string startDate = "06/01/2008";
string endDate = "06/30/2008";
VaultHistoryItem[] items = ServerOperations.ProcessCommandHistory(filePath, bRecursive, DateSortOption.desc, null, excludedList, startDate, endDate, null, null, beginVersion, endVersion, 30);
// output the history items
xml.WriteStartElement("root");
xml.WriteStartElement("History");
XmlHelper.XmlOutput(xml, items);
xml.WriteEndElement();
xml.Close();
Console.Out.WriteLine(sw.ToString());
I've checked in new items today and do not see them in the list. Any ideas would be appreciated.
ServerOperations.client.LoginOptions.URL = "http://devsrv";
ServerOperations.client.LoginOptions.User = "user";
ServerOperations.client.LoginOptions.Password = "pass";
ServerOperations.client.LoginOptions.Repository = "dev-rep";
ServerOperations.client.AutoCommit = true;
ServerOperations.client.Verbose = true;
ServerOperations.client.LoginOptions.AccessLevel = VaultClientNetLib.VaultConnection.AccessLevelType.Admin;
ServerOperations.Login();
string filePath = "$/filepath";
StringWriter sw = new StringWriter();
System.Xml.XmlTextWriter xml = new XmlTextWriter(sw);
xml.Formatting = System.Xml.Formatting.Indented;
//Query the file history so we can view the check in.
bool bRecursive = false;
int beginVersion = -1;
int endVersion = -1;
string excludedList = "add,create,label";
string startDate = "06/01/2008";
string endDate = "06/30/2008";
VaultHistoryItem[] items = ServerOperations.ProcessCommandHistory(filePath, bRecursive, DateSortOption.desc, null, excludedList, startDate, endDate, null, null, beginVersion, endVersion, 30);
// output the history items
xml.WriteStartElement("root");
xml.WriteStartElement("History");
XmlHelper.XmlOutput(xml, items);
xml.WriteEndElement();
xml.Close();
Console.Out.WriteLine(sw.ToString());
I've checked in new items today and do not see them in the list. Any ideas would be appreciated.
No juice. I've attached an .xls file for your review. The tabbed worksheets are named for their source - one from the Vault client, one from the API.
Thanks for your help.
Thanks for your help.
- Attachments
-
- vault-history.xls
- Outputs from Vault Client and API
- (14 KiB) Downloaded 703 times
Can you clarify what you're trying to do exactly?
In the example you are passing a file path, from the excel file I think you actually passed a folder.
Is this what you mean: you want to pass a folder and get back only one entry per file or folder, that entry being the one with the latest version? Or did you want to do them file by file, one history call each?
In the example you are passing a file path, from the excel file I think you actually passed a folder.
Is this what you mean: you want to pass a folder and get back only one entry per file or folder, that entry being the one with the latest version? Or did you want to do them file by file, one history call each?
Ultimately what I'm trying to get is all the checkins to the repository within a date range so we can build weekly releases.
The recursion brought back what I was looking for in that I can now see all the files in the root and subdirectories (hadn't realized this until you mentioned the recursion). This now matches the History filter on the Vault client when recursion is selected. Perfect....except:
Now I only want the most recent version of each file checked in within a date range; and thought using the ProcessCommandHistory could give me what I was looking for.
Thanks very much for your help so far.
The recursion brought back what I was looking for in that I can now see all the files in the root and subdirectories (hadn't realized this until you mentioned the recursion). This now matches the History filter on the Vault client when recursion is selected. Perfect....except:
Now I only want the most recent version of each file checked in within a date range; and thought using the ProcessCommandHistory could give me what I was looking for.
Thanks very much for your help so far.