public IBlame Blame(string revision, string filePath) //[+-] { using (var blame = hg.Blame(revision, filePath)) { return(HgBlame.Parse(blame)); } }
/// <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); }