No announcement yet.

Comparing multiple pairs of file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing multiple pairs of file


    I am using BC 3.3.5 (Build 15075) Pro version on Ubuntu Linux. I am trying to integrate it with a Perforce-compatible source control system. When diff'ing a changelist, this source control system calls the program specified by the env variable $P4DIFF with left and right files as below:

    $P4DIFF old-file new-file.

    If there are multiple files in the changelist, the source control system makes the above call for each pair and waits for the BC window to be closed before launching the next file pair comparison.

    When I set $P4DIFF to /usr/bin/bcompare, things work as expected.

    Now, I want ALL comparions of files in the changelist to be shown in one BC window. Luckily, our source control system supports an environment variable, say MULTI_DIFF, which when set to 1, causes the source control system to call P4DIFF with all file pairs, separated by ":". E.g.:

    $P4DIFF : /tmp/cache/file1#61 /home/me/file1 : /tmp/cache/file2#18 /home/me/file2 : /tmp/cache/file3#52 /home/me/file3

    This fails since this seems to be a wrong command line format for bcompare.exe.

    I would like to have BC open all files in a changelist in a SINGLE window simultaneously. To this end, I have the following questions?

    1) What is the command line for bcompare.exe for passing multiple pairs of files for comparisons? I am thinking of pointing $P4DIFF to a shell script in which I will invoke bcompare.exe with the files, in the right format (e.g. without the ":" separator, etc.)

    2) Will BC open these multiple pairs in multiple tabs in a single window?

    3) Is there a way to have the multiple files appear as a listing in a separate pane (similar to package explore pane in Eclipse). An item in such a pane could be labeled with just the file name (e.g It would be awesome to be able to jump between multiple files in a changelist at ease (tabs is a little difficult to do, IMO).

    I look forward to your answers. And thanks for the wonderful software your company has produced!

  • #2
    Thanks for posting. BC3 does not currently support the MULTI_DIFF variable supplied by Perforce. This is a feature we can look into adding, but our command line support only expects to find single pairs of files when performing a diff. Our Perforce documentation (Windows) is here:

    For the second type of view, BC3 would need to be passed a pair of temp folders containing these file pairs. If part of this MULTI_DIFF process generates this pair of temp folders on the harddrive, we can compare them. Otherwise, this is something else we would have to investigate before implementing. This is a larger project and not one we would likely be able to implement soon, but I can add it to our Customer Wishlist.
    Aaron P Scooter Software


    • #3
      Thanks for your reply. I actually got diffs for ALL files in a changelist to appear simultaneously in a single BC window. The trick is to set P4DIFF to a shell script in which we call bcompare individually for each file. All diff calls use the same window as created by the first compare call (although they create a new tab each time).

      export MULTI_DIFF=1 # All diffs simultaneously
      export P4DIFF=$HOME/bin/
      The script looks like this:

      declare -i left=0
      declare -i right=0
      if [ $# -eq 2 ]
      # MULTI_DIFF must have been unset or empty and hence the source control is calling $P4DIFF with one file comparison at a time.
          # Call BeyondCompare. Note that "-readonly" option makes both sides of the comparison read-only. Replace this with -leftreadonly, etc as appropriate. See
          bcompare -readonly $1 $2 & 
          # MULTI_DIFF is set to a non-empty value and source control calls $P4DIFF with all pairs separated by ":". 
          for (( c=2; c<$#; c=c+3 ))
          do # Open all file diffs in this changelist as multiple tabs in the same BC window.
            # All subsequent compares after the first will open as a new tab.
            bcompare -readonly ${!left} ${!right} &
      See for another post that is somewhat related to this problem and from which I got the idea of repeatedly calling bcompare.

      Regarding my other other question about showing a pane with the files, I would be glad if you could implement this feature. Most of the changes in a changelist are related to each other and we need to go back and forth between each file. A pane based approach is better than tabs, especially if the number of tabs is too many and the tab title gets shortened. In fact, I would like to be greedy and request an even advanced feature: You can allow the user to *create a pane* with *custome ordering of files* in the pane. We can create an ordering based on logical flow or easiest to hard, etc.


      • #4
        Thanks for posting the script; I'll add this to our notes to see if we can incorporate it or work off of it in some way.

        I'll add your additional folder ideas as well, but this is still not likely something we would be tackling soon. We have several larger projects already scheduled.
        Aaron P Scooter Software