Пример #1
0
 public IBlame Blame(string revision, string filePath)                                               //[+-]
 {
     using (var blame = hg.Blame(revision, filePath))
     {
         return(HgBlame.Parse(blame));
     }
 }
Пример #2
0
        /// <summary>
        /// Parse blame stream.
        /// </summary>
        /// <param name="blameData">Hg annotate in incremental format.</param>
        /// <returns>Dictionary of line numbers (from 1) with revisions.</returns>
        public static HgBlame Parse(Stream blameData)
        {
            TextReader reader = new StreamReader(blameData);
            HgBlame    blame  = new HgBlame();
            string     line;
            int        index = 1;

            while ((line = reader.ReadLine()) != null)
            {
                string[] subs = line.Split(':');
                if (subs[0].Length == 40)
                {
                    blame.Add(index, subs[0]);
                    index++;
                }
            }

            return(blame);
        }