Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    May 2006
    Posts
    4

    Default comparing multile files to single output

    hi

    subversion specifc (but could be generic question)

    i have this batch file (my.bat)

    bc2.exe "@script.txt" %7 %6 all.html /silent

    script.txt contain:
    file-report layout:side-by-side options:display-mismatches,line-numbers output-to:%3 output-options:wrap-word,html-color %1 %2

    on a subversion folder where i have muliple files that differ from their base state i run

    svn diff --diff-cmd my.bat


    this envokes the bc2 script and run a comparision on each file that differs. the output is to the same file, all.html, which is overwritten on each comparison.


    i am looking for a solution where the above svn command would generate a "compiled" all.html file showing the differences for every file that differ.


    basically i want the same as a normal svn diff commamd


    svn diff > all.txt


    just using bc2's comparison engine and output.

    can anyone suggest a solution to this ?


    thanks
    ./allan

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,677

    Default Re: comparing multile files to single output

    BC scripts can't append to reports.

    What might work is to have the report append using a batch file.

    Make your batch file two lines:

    bc2.exe "@script.txt" %7 %6 temp.txt /silent
    type temp.txt >> all.txt

    This only works for text file output. The problem with HTML is that each HTML report will have its own HEAD, BODY, etc tags, and if you concatenate invidual report files you'll get them multiple times.

    The other option is to get a copy of the repository version to a temp directory, then use a BC script to generate a single file report of the directories as a whole.
    Chris K Scooter Software

  3. #3
    Join Date
    May 2006
    Posts
    4

    Default Re: comparing multile files to single output

    thanks for the suggestions !

    about generating a single file report of the directories as a whole. i wasn't aware of that was possible.

    i am able to generate a folder-report on two directories, but a file-report on two directories, what would the syntax be like.

    i have tried various combinations like

    load "dir1" "dir2"
    expand all
    file-report layout:side-by-side options:display-mismatches output-to:somefile.txt

    ./allan

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

    Default Re: comparing multile files to single output

    Here's an example of a directory file-report.

    Code:
    load c:\folder1 c:\folder2
    expand all
    select all.files
    file-report layout:side-by-side options:display-mismatches output-to:report.txt
    When you don't name files in the file report command, it operates on the currently selected files. The key is to make sure you have a select command in your script in this case.
    Chris K Scooter Software

  5. #5
    Join Date
    May 2006
    Posts
    2

    Default Re: comparing multile files to single output

    I would like to do something similar but slightly different.

    I want to compare two directory structures and produce separate a patch diff file for each file found to be different - rather than all into one output file.

    For example:
    Folder 1 has files A, B & C and subfolder X with file D.
    Folder 2 has the same structure and files and a new file E. Its files A, C & D are updated versions of folder 1's files of the same name.
    Now I want to create in a separate folder (say called "DIFFS"), files named A.diff.txt, C.diff.txt & D.diff.txt. (I don't mind if D.diffs.txt is in a sub-folder X of folder DIFFS - following the original folder structure.)

    I hope the above is clear.

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,677

    Default Re: comparing multile files to single output

    There isn't a single command that will generate multiple individual file reports.

    With the File-report command, you can either generate a single concatenated diff of multiple files, or generate a single diff of a pair of files.

    If you want to generate a separate report for each pair of files, you'll have to use a script like:
    Code:
    file-report layout:side-by-side options:display-mismatches output-to:%3 %1 %2
    And call the script for each pair of files.
    BC2.exe @script.txt file1 file2 output.txt

    If you know the file names ahead of time, you can automate the script calls using a batch file.
    Chris K Scooter Software

  7. #7
    Join Date
    May 2006
    Posts
    2

    Default Re: comparing multile files to single output

    That is a real shame.

    I have a very large project with 100s of files spread over 10 sub-directories. It would have been nice if BC could have done the compare and then created the necessary individual patch files.

    May I request a (not so distant) future enhancement to the file-report script function to do this given the output from a previous compare and select statements?

    Another option would be to implement something like the "for" statement e.g. "for every file selected to the following commands".

    For example using a previous example in this thread:
    Code:
     
    load c:\folder1 c:\folder2
    expand all
    select diff
    for eachfile
    file-report layout:patch options:ignore-all,patch-context output-to:"reports\%filename%.txt"
    end for
    or something similar!

    David

  8. #8
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,677

    Default Re: comparing multile files to single output

    Thank you for the suggestion. We'll consider adding this feature to Beyond Compare's report capabilities in the future.
    Chris K Scooter Software

  9. #9
    Guest

    Default Re: comparing multile files to single output

    Hi,
    We also will use bc in a batch to automate comparision.
    I would like to add an request for a feature which goes a little bit further but will simply do what in the gui works already.

    Apart from having a html-report for each different file I would like to have a folder-report where one can browse to each file report.

    The code I have does not solve the problem as the file-report puts all in one file.

    actual code ist:
    criteria rules-based
    load "C:\a" "C:\b"
    expand all
    #select diff.files
    select all
    file-report layout:side-by-side options:display-mismatches,line-numbers output-to:report.html output-options:html-color
    folder-report layout:side-by-side options:display-all output-to:freport.html output-options:html-color

    Actually I have to use one script to create a folder-report
    and for each file a file-report and the enhance the folder-report html-file to have html-links to the file-reports.

    It would realy be nice if BC could do the job, because (apart form having to edit the html-file by a script) we have not to run bc for each file and but only one time.

  10. #10
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,677

    Default Re: comparing multile files to single output

    Thank you for the suggestion. Linking the folder report to individual file reports is on our wish list for a future version of Beyond Compare.
    Chris K Scooter Software

Posting Permissions

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