Diff Report for Files in TFS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sjimmerson
    New User
    • Aug 2012
    • 2

    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
  • Aaron
    Team Scooter
    • Oct 2007
    • 16009

    #2
    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

    Comment

    • sjimmerson
      New User
      • Aug 2012
      • 2

      #3
      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

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16009

        #4
        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

        Comment

        Working...