Re: getting the list of files that have a particular label?
From: Dmitry Goncharenko [MSFT] (dgonchREMOVETHECAPS_at_microsoft.com)
Date: 04/29/04
- Next message: Joey Lee: "RE: VSS Admin (not responding)"
- Previous message: Preston L. Bannister: "Re: SccSpy.dll"
- In reply to: steven.gentile_at_wpafb.af.mil: "Re: getting the list of files that have a particular label?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 21:06:14 GMT
Igor,
To do this programmatically you can use VSS automatiuon for example as in the script below:
static void GetItemsOfLabel(string SrcSafeInitPath, string UserName, string PassWord, string RootItem, string Label)
{
IVSSDatabase db = new VSSDatabaseClass();
db.Open(SrcSafeInitPath, UserName, PassWord);
IVSSItem Item = db.get_VSSItem(RootItem, false);
ShowItemsOfLabel(Item, Label);
}
static void ShowItemsOfLabel(IVSSItem Item, string Label)
{
if (Item.Type == (int)VSSItemType.VSSITEM_FILE)
{
LookForLabelInItemHistory(Item, Label);
}
else
{
// Uncomment to see progress
// Console.WriteLine("Scanning " + Item.Spec + " ...");
foreach (IVSSItem ChildItem in Item.get_Items(false))
{
ShowItemsOfLabel(ChildItem, Label);
// This isn't pretty but is needed to release Versions collection
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
}
}
}
static void LookForLabelInItemHistory(IVSSItem Item, string Label)
{
IVSSVersions Versions = Item.get_Versions(0);
foreach (IVSSVersion Version in Versions)
{
string VerLabel = Version.Label;
if (VerLabel == Label)
{
Console.WriteLine("Found:" + Item.Spec);
break;
}
}
}
}
Dmitry Goncharenko (dgonchREMOVETHECAPS@microsoft.com), Visual Studio Core Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: Steve Gentile (steven.gentile@wpafb.af.mil)
> Subject: Re: getting the list of files that have a particular label?
> References: <A4CA16A5-3CC3-43F9-A885-12BA73E3BC35@microsoft.com>
> Date: Thu, 29 Apr 2004 08:25:14 -0700
>
> Right mouse click on the folder you wish to see labels for and choose
> "Show History..." Check the Include Labels and you will see a list of
> files under labels.
>
>
> **********************************************************************
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
- Next message: Joey Lee: "RE: VSS Admin (not responding)"
- Previous message: Preston L. Bannister: "Re: SccSpy.dll"
- In reply to: steven.gentile_at_wpafb.af.mil: "Re: getting the list of files that have a particular label?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|