I have already refered to this post( http://support.sourcegear.com/viewtopic ... eryrequest
), but the code I am trying to use is still not working.
I am trying to exclude all files that are *.dll, this is the code I am using to do it. If anyone knows the correct way please help!
Thanks
VaultLib.VaultHistoryQueryRequest req = new VaultLib.VaultHistoryQueryRequest();
DateTime now = DateTime.Now;
ArrayList users = new ArrayList();
ArrayList substrings = new ArrayList();
ArrayList actions = new ArrayList();
ArrayList sorts = new ArrayList();
sorts.Add((long)VaultQueryRequestSort.DateSort);
req.SubstringType = VaultLib.VaultQueryRequestSubstrings.FileExtensions;
string[] fileExtensions = { "*.dll" }; // this still brings back DLLS from the query?? help?
req.Substrings = fileExtensions;
req.IsFolder = true;
req.Recursive = true;
req.DateFilterType = VaultQueryRequestDateTypes.IncludeRange;
req.DateFilterMask = VaultQueryRequestDates.HistoryBefore | VaultQueryRequestDates.HistoryAfter;
req.EndDate = DateTime.Now;
req.BeginDate = dtBegin;
actions.Clear();
req.CommentFilter = VaultLib.VaultQueryRequestComments.DoNotFilter;
req.RepID = m_vaultClient.ActiveRepositoryID;
req.TopName = repositoryPath;
req.Recursive = true;
req.Users = (VaultLib.VaultUser[])users.ToArray(typeof(VaultLib.VaultUser));
req.Substrings = (string[])substrings.ToArray(typeof(string));
req.Actions = (long[])actions.ToArray(typeof(long));
req.Sorts = (long[])sorts.ToArray(typeof(long));
string token = String.Empty;
int rowsRetrieved = 0;
VaultLib.VaultHistoryItem[] items = new VaultLib.VaultHistoryItem[1];
m_vaultClient.Connection.HistoryBegin(req, 1000, ref rowsRetrieved, ref token);
if (rowsRetrieved > 0)
{
m_vaultClient.Connection.HistoryFetch(token, 0, rowsRetrieved - 1, ref items);
}
API using the VaultQueryRequestSubstrings Help
Moderator: SourceGear
A couple of things that stick out:
1) Since you are not checking dates, you can remove the date range filter.
2) History query on filenames or extensions are inclusive not exclusive. The only way you can exclude files of a specific type is to copy the resulting history array to a new ArrayList, excluding certain file types.
1) Since you are not checking dates, you can remove the date range filter.
2) History query on filenames or extensions are inclusive not exclusive. The only way you can exclude files of a specific type is to copy the resulting history array to a new ArrayList, excluding certain file types.
Jeff Clausius
SourceGear
SourceGear