Get folder history

Examples of programs integrating with Vault and Fortress API. Also, information on integrating with NAnt, CruiseControl.Net and other third-party tools

Moderator: SourceGear

Post Reply
Jackvn2000
Posts: 3
Joined: Mon May 09, 2011 9:37 am

Get folder history

Post by Jackvn2000 » Mon May 09, 2011 9:44 am

Hi,

I am very new to sourcegear. I just want to get the current folder history. How can I do that by just passing the repository path?

thank you very much.
Jack

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Get folder history

Post by lbauer » Mon May 09, 2011 1:38 pm

Check the API examples here:

http://support.sourcegear.com/viewtopic.php?f=31&t=8020
Specifically:

Code: Select all

//Query the file history so we can view the check in.
            bool bRecursive = false;
            int beginVersion = -1;
            int endVersion = -1;
            VaultHistoryItem[] items = ServerOperations.ProcessCommandHistory(filePath, bRecursive, DateSortOption.desc, null, null, VaultDate.EmptyDate().ToString(), VaultDate.EmptyDate().ToString(), null, null, beginVersion, endVersion, 10);

            // output the history items
            xml.WriteStartElement("root");

            xml.WriteStartElement("History");
            XmlHelper.XmlOutput(xml, items);
            xml.WriteEndElement();

            xml.Close();
            Console.Out.WriteLine(sw.ToString());
        }

        public static void WildcardTasks()
        {
            string url = "http://VaultServer/VaultService";
            string username = "username";
            string password = "password";
            string repository = "Your Repository";
Linda Bauer
SourceGear
Technical Support Manager

Post Reply