Andrew Hall
Andrew Hall

Reputation: 3073

How does subversion check file differences between working copy & server?

I am trying to understand how svn works at the socket level when checking differences between the working copy and the last revision on the server.

I have been following this article: http://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_ra_svn/protocol

Which explains the protocol but I am still unclear on how subversion checks differences when you issue a "svn status".

I am looking for a way I can replicate this behaviour as is I was implementing my own SVN client.

Upvotes: 0

Views: 307

Answers (1)

alroc
alroc

Reputation: 28144

It doesn't, AFAIK.

When you run svn st, the timestamp of the WC copy of the file is checked against the timestamp of the last time you ran svn update on the WC (the pristine copy). If they differ, a checksum of the file is calculated and compared against a checksum of the pristine copy. If that differs, the diff algorithm calculates the differences.

When you run svn st -u, the client says to the server "my working copy is at revision X, what items have changed since then?" (note: not "what changes have happened" but rather a simple "give me a list of what items have changed") and the server returns a list (including any locks that exist). No other diffing (that I'm aware of) happens.

Upvotes: 1

Related Questions