Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Source Safe / December 2003

Tip: Looking for answers? Try searching our database.

OLE sample code in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
erana@elbit.co.il - 30 Dec 2003 10:54 GMT
I'm using the OLE sample code in C# for VSS automation.
I tried to call GetByLabel recursively but it doesn't work.
Any one know how to get a tree by label in C# or other
language ?

Thanks
Christopher Kimbell - 30 Dec 2003 20:17 GMT
Hi,

I had the same problem some time ago.
I had to implement the recursion my self, here is how I did it:

private void GetVssProjectVersion(string Spec, string GetPath, string
Version, bool Recursive)
{
   VSSItem VSSProject;
   VSSItem VSSProjectVersion;

   VSSProject = mVSSDatabase.get_VSSItem(Spec,false);
   VSSProjectVersion = VSSProject.get_Version("Version " + Version);

   VSSProjectVersion.Get(ref GetPath,0);

    if(Recursive == true)
   {
       IVSSItems items = VSSProject.get_Items(false);

       foreach(VSSItem Item in items)
       {
            if(Item.Type == (int)VSSItemType.VSSITEM_PROJECT)
            {
                  GetVssProjectVersion(Spec + "/" + Item.Name,GetPath +
"\\" +Item.Name,Version,Recursive);
             }
        }
   }
}

On a side note:
If you are going to add items, then label them from code, make sure that you
don't do things to fast.
I was migrating several thousand versions from our old archive(UNIX) to
SourceSafe, and wrote a program to do it.
The problem I discovered was that things got labeled wrong, several versions
got checked in before the label was set.
The solution was to introduce a 1.5 second delay between the add and label
operation.

The program I wrote was in VB6 and used VSS prior to 6.0c that came with
VS.NET so things may have changed,
but you should be aware that it might still be a problem.

Chris

> I'm using the OLE sample code in C# for VSS automation.
> I tried to call GetByLabel recursively but it doesn't work.
> Any one know how to get a tree by label in C# or other
> language ?
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.