Does anyone know if it is possible to use the TFS Difference.DiffFiles() methods on files that are not under source control? I know when I am in the source control UI I can select local paths that let me move outside of the workspace. I have made some efforts towards getting this to work but I am not sure how to read the DiffSegment results.
options.Flags = DiffOptionFlags.None;
options.OutputType = DiffOutputType.Unified;
options.TargetEncoding = Console.OutputEncoding;
options.SourceEncoding = Console.OutputEncoding;
options.StreamWriter = new StreamWriter(memStream);
options.StreamWriter.AutoFlush = true;
DiffSegment seg = Difference.DiffFiles(pathA, Encoding.UTF8.WindowsCodePage, pathB, Encoding.UTF8.WindowsCodePage, options);
In some lite testing I can seem to see segments that get added but the OriginalStart seems to match the ModifiedStart so I just may not want to do this. If anyone has recommendations on a decent Diff API I’m open.
tfs api most definitely allows you to compare two local files. I don’t think you need most of the DiffOptionFlags, you can just do the following:
As Mohamed describes briefly here.
Russell describes in details what to do with DiffSegment here.
For example I did the following
Hope this helps!