[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Subversion equivalent to VSS diff for binary files

From: Mark Phippard <markphip_at_gmail.com>
Date: Fri, 15 Oct 2010 12:40:30 -0400

Replying to list.

On Fri, Oct 15, 2010 at 12:28 PM, Phil Pinkerton <pcpinkerton_at_gmail.com> wrote:

> I am having a time understanding this also:
>
> OK here is what details I have quoted from from the other team:
>
> "A few things I want to point out...Subversion was meant for handling
> text files not binary files.  WTX files (source and compiled maps,
> typetrees, etc) are binary, so SVN is pretty much clueless about the
> files.

Not true. SVN uses binary deltas for all file types and handles text
and binaries well. SVN's handling of binaries is a strength compare
to some other tools.

> In the section about merging I'm only referring to merging the files,
> not the file contents - since it (SVN) can't read our files.

SVN cannot do contextual merging of binary files. I do not believe
any tool can. However, GUI tools like TortoiseSVN and Subclipse
provide ways to tie in custom tools. For example, you can merge a
Word document by having it invoke a script that invokes Word's merge
tool.

> As part of that, Subversion is not capable of doing any diffs (once
> again no binary support).

Again, wrong. See:

http://svnbook.red-bean.com/nightly/en/svn.forcvs.binary-and-trans.html

> It also can't tell if a file has really changed or not...so lets say
> you rebuild or save a WTX file without actually making changes...SVN
> will check it in and act like the file is different from before when
> it actually didn't change (VSS will do a binary diff and if it is the
> same it won't update the server). "
>
> So my guess is they want to know if the binary files has indeed
> changed. My experience is that there is no application that truly does
> a binary diff at least not one integrated into Subversion.
>
> Here is what VSS does:
>
> the Show Differences command. With a binary file, Visual SourceSafe
> stores each change as a small record of which bytes moved where:
> useful for reconstructing earlier versions, but not for display.
> Therefore, when you use the Show Differences command on a binary file,
> Visual SourceSafe can tell you if the file has changed; but it cannot
> display how the file has changed.
>
> Is there an equivalent method in Subversion ?

This is exactly how SVN operates. It does a binary delta on the file
and only if there are true differences it sends those to the server.
It uses the xdelta algorithm and it sends the byte changes only.
Again, this is actually how it handles text-based files too. It does
other work to turn those binary deltas back into something that looks
like a line-oriented change. This is one of the reasons that when
looking at SVN history you cannot easily see line-based stats on the
lines of code modified. SVN stores binary deltas so to present that
info you need to do an svn diff to turn it back into something that
looks line based.

SVN will never commit a file that does not have a binary difference
between the versions.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on 2010-10-15 18:41:08 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.