Ejemplo n.º 1
0
        public override Annotation[] GetAnnotations(FilePath localPath)
        {
            List <Annotation> annotations = new List <Annotation> (Svn.GetAnnotations(this, localPath, SvnRevision.First, SvnRevision.Base));
            Annotation        nextRev     = new Annotation(GettextCatalog.GetString("working copy"), "", DateTime.MinValue);
            var baseDocument    = new Mono.TextEditor.Document(File.ReadAllText(GetPathToBaseText(localPath)));
            var workingDocument = new Mono.TextEditor.Document(File.ReadAllText(localPath));

            // "SubversionException: blame of the WORKING revision is not supported"
            foreach (var hunk in baseDocument.Diff(workingDocument))
            {
                annotations.RemoveRange(hunk.InsertStart, hunk.Inserted);
                for (int i = 0; i < hunk.Inserted; ++i)
                {
                    annotations.Insert(hunk.InsertStart, nextRev);
                }
            }

            return(annotations.ToArray());
        }
		public override Annotation[] GetAnnotations (FilePath localPath)
		{
			List<Annotation> annotations = new List<Annotation> (Svn.GetAnnotations (this, localPath, SvnRevision.First, SvnRevision.Base));
			Annotation nextRev = new Annotation (GettextCatalog.GetString ("working copy"), "", DateTime.MinValue);
			var baseDocument = new Mono.TextEditor.Document (File.ReadAllText (GetPathToBaseText (localPath)));
			var workingDocument = new Mono.TextEditor.Document (File.ReadAllText (localPath));
			
			// "SubversionException: blame of the WORKING revision is not supported"
			foreach (var hunk in baseDocument.Diff (workingDocument)) {
				annotations.RemoveRange (hunk.InsertStart, hunk.Inserted);
				for (int i = 0; i < hunk.Inserted; ++i) {
					annotations.Insert (hunk.InsertStart, nextRev);
				}
			}
			
			return annotations.ToArray ();
		}