0

I have never wrote a script before and I was asked today to make a Visual SourceSafe script that returns all of the labels that are stored.

I have 0 idea on how to start this as I have never wrote a script before. Can anybody point me in the right direction with this please? Thanks!

Ayohaych
  • 5,099
  • 7
  • 29
  • 51
  • 1
    "Visual SourceSafe" - Still? Really? AAAaarrrghh!!! – Mitch Wheat Jul 26 '13 at 10:41
  • @MitchWheat What? If it's something to do with it being shit its nothing to do with me ha I was just asked to make a script, I'm interning at a company. Any help? – Ayohaych Jul 26 '13 at 10:46

1 Answers1

1

You can use the History command of SourceSafe to get the history info of an item and extract the label info you need.

Here is a simple sample for you:

private void GetItem(VSSItem vssItem)
    {

            if (vssItem.Type == 0)  //Type == 0 means it's a project
            {
                bool bIncludeDeleted = false;
                IVSSItems vssItems = vssItem.get_Items(bIncludeDeleted);
                foreach (VSSItem vssitem in vssItems)
                {
                    GetItem(vssitem);

                    foreach (IVSSVersion vssVersion in vssitem.get_Versions(0))
                    {
                        string vssItemName = "";
                        if (vssVersion.VSSItem.Name == "")
                            vssItemName = vssitem.Spec;
                        else
                            vssItemName = vssVersion.VSSItem.Spec;

                        if (vssVersion.Action.IndexOf("Label") > -1 )
                        {
                            if (vssitem.Spec == vssVersion.VSSItem.Spec)
                            {

                                MessageBox.Show("Item " + vssItemName + " in " + "Version " + vssVersion.VersionNumber.ToString() + " With the lable:  " + vssVersion.Label);
                            }

                        }
                    }

                }
            }     
Rachel
  • 1,372
  • 1
  • 8
  • 11