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

Re: Commits files to subversion from 2 different directories

From: Ryan Schmidt <subversion-2007a_at_ryandesign.com>
Date: 2007-01-16 00:33:44 CET

On Jan 15, 2007, at 11:11, ying lcs wrote:

> On 1/15/07, Ryan Schmidt wrote:
>
>> > i did your suggestion. It works. And at the end i did a 'svn
>> > --summarize diff' to show the difference between 2 versions.
>> >
>> > however, I notice there are entries which show files whose
>> content are
>> > identical. Can you please tell me why is that (content is the
>> same but
>> > timestamps are different)? If that is the case, is it possible to
>> > filter those result out? i.e. just show files which are content
>> > different?
>>
>> Um... Subversion doesn't even store files' timestamps in the
>> repository, so the only reason for the files to be showing up in the
>> list is if their content ("M" in the first column) or their
>> properties ("M" in the second column) are in fact different.
>>
>> If the M appears in the second column: Perhaps you changed the
>> properties on a file? If so you can filter these out of the list by
>> finding those lines where the first column is empty and the second
>> column is an M and removing those lines from the output, for example
>> by piping the output of "svn diff --summarize" through grep, sed
>> or awk.
>>
>> Or perhaps the file content does in fact differ, but only in white
>> space or line ending? Perhaps you have auto-props set up with
>> svn:eol-
>> style, and perhaps they were not set on the initial import, but were
>> on the second load, or vice versa? If so, I'm not sure how best to
>> exclude these items from the output. You may have to save the list of
>> files and do a manual comparison of the files using your own
>> criteria. For example, you could examine each file using your OS's
>> diff program's -b option which ignores whitespace.
>
> Here is one of the example of the svn summary output:
>
> M file:///srv/svn/repositories/test/tags/VERSION0/server/tests/
> src/JNI/java/Test1.java
> (M is second column)
>
> $ cd ~/org-source
> $ ls -la Test1.java
> -rwxrwxr-x 1 yinglcs yinglcs 17780 Dec 7 15:11 Test1.java*
>
> $ cd ~/mod-source
> $ ls -la Test1.java
> -rwxrwxr-x 1 yinglcs yinglcs 17780 Apr 18 2004 Test1.java*
> They have the same size and permission.
>
> The difference is empty:
> $ diff Test1.java ~/mod-source/server/tests/src/JNI/java/Test1.java
> $

Ok. So since the M is in the second column, that means the properties
are different. Since the first column is a blank space, that means
the file contents are identical. If you would like to exclude such
files from the list, simply pipe the output of "svn diff --summarize"
through grep, sed, or awk, whatever you prefer. For example, the
following excludes lines beginning with a space:

svn diff --summarize \
file:///srv/svn/repositories/source/tags/VERSION1 \
file:///srv/svn/repositories/source/tags/VERSION2 \
| grep -v '^ '

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 16 00:55:50 2007

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.