Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Default Diff Report for Files in TFS

    I would like to be able to execute a BC3 script that will diff two files in TFS source control (without downloading the files locally) and produce an HTML report of the differences (differences only with context actually).

    Is there a way to script this with BC3? If so how do you do this--specifically how do you diff two files in TFS source control?


    Ultimately I just need the <table> that shows the file differences from the report as I want to add this to another report that contains additional information about each changeset for the two files.

    Thanks,
    Shane

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,618

    Default

    Hello,

    To open the files, they would need to be accessible via a path that can be opened in the graphical interface. This path would need to be a drive letter, a network share, or FTP site. As you have mentioned, downloading the pair of files would be the easiest method if TFS does not support browsing the repository as a directory. There may be 3rd party applications that allow this browsing.

    Once you are able to open the path in the Text Compare (similar to "C:\file1.txt"), then you can proceed to create a script that generates a report on the files with that pair of paths:

    bcompare.exe "@c:\script.txt" "c:\file1.txt" "c:\file2.txt" "c:\report.txt"

    where script.txt is:
    text-report layout:side-by-side options:display-mismatches output-to:"%3" output-options:html-color %1 %2
    Aaron P Scooter Software

  3. #3
    Join Date
    Aug 2012
    Posts
    2

    Default

    Thanks for the reply!

    I thought there may have been a way to do this without downloading the files from TFS first due to the TFS integration in BC. Is there any way to take advantage of the TFS integration in the script? How does BC compare files located in TFS source control when called from the Visual Studio? Does it download the files first to some temp location? Is it relying on Visual Studio/Team Explorer to download the files first? Other?

    Shane

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,618

    Default

    Hello,

    The source control integration calls out to the VCS (TFS, in this case), and it is responsible for creating the temp files necessary for that specific Diff or Merge. A few other version controls are capable of storing a their information on the local/browse-able harddrive, but I do not believe this is a normal, built-in feature of TFS.
    Aaron P Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •