Пример #1
0
        public static CommitInfo GetSvnCommitInfo(int revision)
        {
            StringBuilder argBuilder = new StringBuilder();
            argBuilder.Append(" log");
            argBuilder.Append(" --xml");
            argBuilder.Append(" -r" + revision);
            argBuilder.Append(" --non-interactive");
            argBuilder.Append(" --no-auth-cache");
            argBuilder.Append(" " + Quote("http://unreal.tepkom.ru/svn/unreal/"));

            ProcessStartInfo info = new ProcessStartInfo("svn.exe", argBuilder.ToString());
            info.UseShellExecute = false;
            info.ErrorDialog = false;
            info.CreateNoWindow = true;
            info.RedirectStandardOutput = true;

            Process process = new Process();
            process.StartInfo = info;
            process.Start();
            string processResult = process.StandardOutput.ReadToEnd();
            process.WaitForExit();

            XmlDocument xml = new XmlDocument();
            xml.LoadXml(processResult);

            XmlNode node = xml.SelectSingleNode("/log/logentry");
            XmlNode messageNode = node.SelectSingleNode("msg");
            string message = messageNode != null ? EncodeMessageForConsoleOutput(messageNode.InnerText) : null;
            XmlNode authorNode = node.SelectSingleNode("author");
            string author = authorNode != null ? authorNode.InnerText : null;
            CommitInfo commitInfo = new CommitInfo(message, author);
            return commitInfo;
        }
Пример #2
0
        public static CommitInfo GetSvnCommitInfo(int revision)
        {
            StringBuilder argBuilder = new StringBuilder();

            argBuilder.Append(" log");
            argBuilder.Append(" --xml");
            argBuilder.Append(" -r" + revision);
            argBuilder.Append(" --non-interactive");
            argBuilder.Append(" --no-auth-cache");
            argBuilder.Append(" " + Quote("http://unreal.tepkom.ru/svn/unreal/"));

            ProcessStartInfo info = new ProcessStartInfo("svn.exe", argBuilder.ToString());

            info.UseShellExecute        = false;
            info.ErrorDialog            = false;
            info.CreateNoWindow         = true;
            info.RedirectStandardOutput = true;

            Process process = new Process();

            process.StartInfo = info;
            process.Start();
            string processResult = process.StandardOutput.ReadToEnd();

            process.WaitForExit();

            XmlDocument xml = new XmlDocument();

            xml.LoadXml(processResult);

            XmlNode node        = xml.SelectSingleNode("/log/logentry");
            XmlNode messageNode = node.SelectSingleNode("msg");
            string  message     = messageNode != null?EncodeMessageForConsoleOutput(messageNode.InnerText) : null;

            XmlNode    authorNode = node.SelectSingleNode("author");
            string     author     = authorNode != null ? authorNode.InnerText : null;
            CommitInfo commitInfo = new CommitInfo(message, author);

            return(commitInfo);
        }