svn diff with multiple files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuval
    New User
    • Dec 2014
    • 2

    svn diff with multiple files

    I'm using the svn integration as detailed in the instructions. When running 'svn diff' on multiple files, this results in svn diffing the files one-by-one, i.e. it waits for the tab of the current diff to close before it starts the next diff. I suppose bcomp only exits when the tab it opened is closed.

    I prefer to open all the diffs in multiple tabs instead - this is useful for code review purposes, and prevents a delay when opening the next diff (especially if the svn server is slow to respond, as in my workplace).

    I modified bcdiff.sh to run bcompare instead of bcomp but ran into a problem: Multiple tabs were opened, but all of them blank. It looks like when diffing between previous versions, svn uses temporary files and they are deleted when bcdiff.sh exits. So by the time the the new tab displays the diff, bcompare already exits and the temporary files are gone. Adding 'sleep 0.5' after bcompare works around this issue and all the diffs are displayed correctly.

    Would it be possible to modify bcompare, or add an option, so it only exits once Beyond Compare reads the contents of the files?

    Here's my bcdiff.sh for reference in case anyone else is interested in this workflow:
    Code:
     #! /bin/bash
    /usr/local/bin/bcompare "$6" "$7" -title1="$3" -title2="$5" -ro1
    sleep 0.5
    exit 0
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Thanks for the feedback and idea. This is something we can look into, but in the meantime you would need to use the wrapper workaround.
    Aaron P Scooter Software

    Comment

    • mwb1100
      Visitor
      • Oct 2014
      • 8

      #3
      I'd like to +1 this request.

      Just in case anyone else wants to do this on Windows, the script that yuval posted works fine with mostly straight forward changes needed for Windows batch files. I also was able to use a sleep command from MSYS that I happened to have on my machine - I imagine that there's a native Windows command that will do the same thing.

      The couple of non-obvious changes were:

      - the title options cannot have quotes since SVN adds the quotes itself
      - I used "/ro" instead of "/ro1" because SVN would pass a temporary file sometimes for the file in my working copy (just sometimes - I don't really understand why or exactly when). I'd rather be told I can't edit a file than have my edits randomly disappear mysteriously.

      Here's what I ended up with on Windows:

      Code:
      @echo off
      start "" "c:\PROGRA~2\BEYOND~2\bcompare.exe" "%6" "%7" /title1=%3  /title2=%5 /ro
      sleep 0.5
      IF %errorlevel%==0 goto ZERO
      EXIT /B 1
      :ZERO
      EXIT /B 0

      Comment

      Working...