1

I want to use beyond compare to compare the difference between two version of the .doc file under SVN and save the result in a text file. SO far seeing all the guides I was able to successfully integrate BC with "diffViewer" tweaking the externals adding the path and files to compare. But I am unable to replicate the same in command prompt.

For example: svn diff -c 4 test.txt >>log.txt this gives the difference between the current version and 4th version and stores the difference in log.txt. Is it possible to do same with .doc files?

https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html#tsvn-automation-basics

Read this link above but again running the modified command : TortoiseProc.exe /command:diff /startrev:4 /endrev:6 /path:"C:\svnroot\test2\trunk\Files\log.docx" opens beyond compare or anyother program specified in the diffViewer.

Huntkil
  • 131
  • 8

1 Answers1

1

Configure Beyond Compare as a diff tool following the Subversion instructions on Scooter Software's website.

  1. Go into the Beyond Compare installation folder (eg, C:\Program Files\Beyond Compare 4).
  2. Create a batch file named "bc4svn.bat" containing:

    call "%~dp0\bcomp.exe" "%6" /title1=%3 "%7" /title2=%5
    IF %errorlevel%==0 goto ZERO
    EXIT /B 1
    :ZERO
    EXIT /B 0

  3. Go into Subversion's per-user configuration area, typically C:\Users\username\AppData\Roaming\Subversion.

  4. Edit "config" and change the following lines:

    [helpers]

    diff-cmd = "C:\Program Files\Beyond Compare 4\bc4svn.bat"

After you've configured Beyond Compare as a diff tool, you should be able to launch a diff using:

svn diff file.doc

To output comparison results to a printer, HTML, or plain text from the Text Compare, use the Session | Text Compare Report command.

If you use TortoiseSVN instead of command-line tools, follow the TortoiseSVN instructions on Scooter Software's website. TortoiseSVN overrides the default diff tool for DOC and DOCX files, to use Beyond Compare you'll need to click the Advanced button in the Diff Viewer settings and delete the overrides for DOC and DOCX.

Chris Kennedy
  • 2,639
  • 12
  • 11
  • Already done that but this has no effect, it does not produce the desired result. – Huntkil Dec 21 '16 at 12:33
  • Are you using command line SVN or TortoiseSVN? Are error messages displayed when you attempt to diff .doc files, or does nothing happen (BC not opened, no errors displayed)? – Chris Kennedy Dec 21 '16 at 15:45
  • I have used both SVN and tortoiseSVN. In tortoiseSVN changing the ommand as per my need results in a beyond compare pop up wich shows difference between the two. The SVN bat file is used was as below : – Huntkil Dec 22 '16 at 10:10
  • @ECHO OFF SET DIFF="BCompare.exe" SET LEFT=%6 SET RIGHT=%7 %DIFF% %LEFT% %RIGHT% – Huntkil Dec 22 '16 at 10:12
  • one more info in SVN this command didnt work. Its throwing an error bc4svn.bat unrecognized batch file. – Huntkil Dec 22 '16 at 10:14
  • You need to use the exact bc4svn.bat file as listed above, don't modify it. I tested it using a text file and a .doc file and it worked correctly on my Windows 7 x64 system with svn 1.9.5 and BC 4.1.9. DOC is binary file type, so you'll need to use the command "svn diff --force file.doc" or it won't launch a diff. – Chris Kennedy Dec 23 '16 at 20:53