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

dirs_same_p and summarizing diff

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Thu, 09 Oct 2008 07:28:43 +0200

Hi Julian,

many thanks for your much-needed clarifications on the editor/diff callbacks
frameworks! I'll try to put them to practice.

Julian Foad wrote:
> Great. It doesn't seem to be working quite right yet, though. A simple
> test on the command line, in a Subversion WC with your patch applied,
> shows:
>
> [[[
> $ svn status
> M subversion/tests/cmdline/merge_tests.py
> M subversion/libsvn_client/merge.c
> M subversion/libsvn_client/diff.c
> M subversion/libsvn_client/repos_diff_summarize.c
>
> $ svn diff --summarize -r33519 subversion/
> M subversion/subversion/libsvn_wc/update_editor.c
> ]]]

lol, that bad :)
I wonder why the merge tests using it to compare directories are passing, then.

> There are two different mechanisms for (streamily) representing a tree
> diff: the "delta editor" and the "diff callbacks". In the existing (svn
> 1.5) diff code, notice how the two different mechanisms are used:
>
> (repos <> repos):
>
> normal-diff:
> editor = svn_client__get_diff_editor(CALLBACKS);
> reporter = svn_ra_do_diff3(editor);
> reporter->finish_report();
>
> diff-summarize:
> editor = svn_client__get_diff_summarize_editor(SUMMARIZE_FUNC);
> reporter = svn_ra_do_diff3(editor);
> reporter->finish_report();
>
> (repos <> wc):
>
> normal-diff:
> editor = svn_wc_get_diff_editor5(CALLBACKS);
> reporter = svn_ra_do_diff3(editor);
> svn_wc_crawl_revisions3(reporter);
>
> diff-summarize:
> n/a
>
> (wc <> wc):
>
> normal-diff:
> svn_wc_diff5(CALLBACKS);
>
> diff-summarize:
> n/a
>

What about another case I encountered today in ./merge_tests.py 88 89:
 foreign-repos <> wc

A diff doesn't work, but a merge does (test script attached):

A wc1/file
Adding wc1/file
Transmitting file data .
Committed revision 1.
A wc2/file
+ svn diff --old=file:////arch/elego/svn/test/repos1 --new=wc2
subversion/libsvn_ra_local/ra_plugin.c:266: (apr_err=170000)
svn: 'file:///arch/elego/svn/test/repos1'
is not the same repository as
'file:///arch/elego/svn/test/repos2'
+ echo

+ svn merge -c 1 file:////arch/elego/svn/test/repos1 wc2
Conflict discovered in 'wc2/file'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: e
Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: r
--- Merging (from foreign repository) r1 into 'wc2':
A wc2/file
C wc2

So, if we were to add a summarizing-diff before each merge, it would break
all foreign-repos merges...

>> A couple of tests still fail with my patch, I'll investigate.
>> merge_tests.py 3 88 89 114 115 119
>> diff_tests.py 45

I fixed all but merge_tests.py 88 and 89, the foreign-repos ones.

Also, I haven't actually checked *all* of the commandline tests. It takes
ages to complete, with apparent longer breaks of doing nothing at all, when
watching the CPU and disk activity.

And then I have to run it twice, once for trunk and once for my patch, to be
able to compare test outcomes. How do you handle this kind of situation?

...and, I think I'd like to open a micro-branch for this thing. I can just
decide about that myself now, right?

Thanks
~Neels

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

#!/bin/sh

# The next line is the only line you should need to adjust.
SVNDIR=/arch/elego/svn/trunk

## GENERIC PREPARATIONS

SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# use my local way if my script is there (neels).
if [ -x /usr/local/bin/svnremake ]; then
  SVN=svn
  SVNSERVE=svnserve
  SVNADMIN=svnadmin
fi

${SVN} --version

# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/neels/repos
# URL=svn://localhost/repos
URL1=file:///`pwd`/repos1
URL2=file:///`pwd`/repos2

rm -rf repos1 wc1 repos2 wc2

${SVNADMIN} create repos1
${SVNADMIN} create repos2

# These are for svnserve only.
echo "[general]" > repos1/conf/svnserve.conf
echo "anon-access = write" >> repos1/conf/svnserve.conf
echo "auth-access = write" >> repos1/conf/svnserve.conf
echo "[general]" > repos2/conf/svnserve.conf
echo "anon-access = write" >> repos2/conf/svnserve.conf
echo "auth-access = write" >> repos2/conf/svnserve.conf

# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k

${SVN} co -q ${URL1} wc1
${SVN} co -q ${URL2} wc2

## ACTUAL TEST

echo x > wc1/file
${SVN} add wc1/file
${SVN} ci -m m wc1

echo y > wc2/file
${SVN} add wc2/file

set -x
${SVN} diff --old=${URL1} --new=wc2

echo

${SVN} merge -c 1 ${URL1} wc2

## ACTUAL TEST ENDS
echo "====="

./k

Received on 2008-10-09 07:29:08 CEST

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

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