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

more wc-ng node revision differences that affect 'svn diff'

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 18 Oct 2009 21:12:43 +0200

Hey,

The patch below results in test failures, as shown below.

Like other failures I've seen, the tests fail because revisions
reported by wc-ng for added or deleted nodes don't match up with
what wc-1 reported.

Can someone explain the rationale behind these differences?
Should I simply adjust the expected output or do these tests failures
exhibit undesired behaviour?

Thanks,
Stefan

[[[
* subversion/libsvn_wc/diff.c
  (report_wc_file_as_added): Stop using svn_wc_entry_t, and use WC-NG
   APIs instead. This function no longer takes an ENTRY parameter.
  (report_wc_directory_as_added, delete_entry): Track parameter removal.
]]]

Index: subversion/libsvn_wc/diff.c
===================================================================
--- subversion/libsvn_wc/diff.c (revision 40094)
+++ subversion/libsvn_wc/diff.c (working copy)
@@ -909,15 +909,13 @@ directory_elements_diff(struct dir_baton *db)
  * as having been added.
  *
  * DIR_BATON is the parent directory baton, ADM_ACCESS/PATH is the path
- * to the file to be compared. ENTRY is the working copy entry for
- * the file.
+ * to the file to be compared.
  *
  * Do all allocation in POOL.
  */
 static svn_error_t *
 report_wc_file_as_added(struct dir_baton *db,
                         const char *path,
- const svn_wc_entry_t *entry,
                         apr_pool_t *pool)
 {
   struct edit_baton *eb = db->eb;
@@ -929,6 +927,8 @@ report_wc_file_as_added(struct dir_baton *db,
   const char *source_file;
   const char *translated_file;
   const char *local_abspath;
+ svn_wc__db_status_t status;
+ svn_revnum_t revision;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
@@ -939,14 +939,25 @@ report_wc_file_as_added(struct dir_baton *db,
 
   SVN_ERR(get_empty_file(eb, &empty_file));
 
+ SVN_ERR(svn_wc__db_read_info(&status, &revision, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, eb->db, local_abspath,
+ pool, pool));
+
+ if (status == svn_wc__db_status_added)
+ SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, eb->db, local_abspath,
+ pool, pool));
+
   /* We can't show additions for files that don't exist. */
- SVN_ERR_ASSERT(!(entry->schedule == svn_wc_schedule_delete
- && !eb->use_text_base));
+ SVN_ERR_ASSERT(status != svn_wc__db_status_deleted || eb->use_text_base);
 
   /* If the file was added *with history*, then we don't want to
      see a comparison to the empty file; we want the usual working
      vs. text-base comparison. */
- if (entry->copied)
+ if (status == svn_wc__db_status_copied ||
+ status == svn_wc__db_status_moved_here)
     {
       /* Don't show anything if we're comparing to BASE, since by
          definition there can't be any local modifications. */
@@ -985,7 +996,7 @@ report_wc_file_as_added(struct dir_baton *db,
                                     NULL, NULL, NULL,
                                     path,
                                     empty_file, translated_file,
- 0, entry->revision,
+ 0, revision,
                                     NULL, mimetype,
                                     NULL, SVN_INVALID_REVNUM,
                                     propchanges, emptyprops,
@@ -1083,7 +1094,7 @@ report_wc_directory_as_added(struct dir_baton *db,
       switch (entry->kind)
         {
         case svn_node_file:
- SVN_ERR(report_wc_file_as_added(db, path, entry, iterpool));
+ SVN_ERR(report_wc_file_as_added(db, path, iterpool));
           break;
 
         case svn_node_dir:
@@ -1217,7 +1228,7 @@ delete_entry(const char *path,
       else
         {
           /* Or normally, show the working file being added. */
- SVN_ERR(report_wc_file_as_added(pb, full_path, entry, pool));
+ SVN_ERR(report_wc_file_as_added(pb, full_path, pool));
         }
       break;
     case svn_node_dir:

$ ./diff_tests.py --verbose 27 32 34
CMD: svnadmin create svn-test-work/local_tmp/repos --bdb-txn-nosync
<TIME = 0.321006>
CMD: svn import -m "Log message for revision 1." svn-test-work/local_tmp/greekfiles file:///home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/repos --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.698658>
Adding svn-test-work/local_tmp/greekfiles/A
Adding svn-test-work/local_tmp/greekfiles/A/B
Adding svn-test-work/local_tmp/greekfiles/A/B/lambda
Adding svn-test-work/local_tmp/greekfiles/A/B/E
Adding svn-test-work/local_tmp/greekfiles/A/B/E/alpha
Adding svn-test-work/local_tmp/greekfiles/A/B/E/beta
Adding svn-test-work/local_tmp/greekfiles/A/B/F
Adding svn-test-work/local_tmp/greekfiles/A/mu
Adding svn-test-work/local_tmp/greekfiles/A/C
Adding svn-test-work/local_tmp/greekfiles/A/D
Adding svn-test-work/local_tmp/greekfiles/A/D/gamma
Adding svn-test-work/local_tmp/greekfiles/A/D/G
Adding svn-test-work/local_tmp/greekfiles/A/D/G/rho
Adding svn-test-work/local_tmp/greekfiles/A/D/G/pi
Adding svn-test-work/local_tmp/greekfiles/A/D/G/tau
Adding svn-test-work/local_tmp/greekfiles/A/D/H
Adding svn-test-work/local_tmp/greekfiles/A/D/H/chi
Adding svn-test-work/local_tmp/greekfiles/A/D/H/omega
Adding svn-test-work/local_tmp/greekfiles/A/D/H/psi
Adding svn-test-work/local_tmp/greekfiles/iota

Committed revision 1.
CMD: svnadmin create svn-test-work/repositories/diff_tests-27 --bdb-txn-nosync
<TIME = 0.370442>
CMD: svnadmin dump svn-test-work/local_tmp/repos | svnadmin load svn-test-work/repositories/diff_tests-27 --ignore-uuid
<TIME = 0.454504>
CMD: svn co file:///home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/repositories/diff_tests-27 svn-test-work/working_copies/diff_tests-27 --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 1.107292>
A svn-test-work/working_copies/diff_tests-27/A
A svn-test-work/working_copies/diff_tests-27/A/B
A svn-test-work/working_copies/diff_tests-27/A/B/lambda
A svn-test-work/working_copies/diff_tests-27/A/B/E
A svn-test-work/working_copies/diff_tests-27/A/B/E/alpha
A svn-test-work/working_copies/diff_tests-27/A/B/E/beta
A svn-test-work/working_copies/diff_tests-27/A/B/F
A svn-test-work/working_copies/diff_tests-27/A/mu
A svn-test-work/working_copies/diff_tests-27/A/C
A svn-test-work/working_copies/diff_tests-27/A/D
A svn-test-work/working_copies/diff_tests-27/A/D/gamma
A svn-test-work/working_copies/diff_tests-27/A/D/G
A svn-test-work/working_copies/diff_tests-27/A/D/G/pi
A svn-test-work/working_copies/diff_tests-27/A/D/G/rho
A svn-test-work/working_copies/diff_tests-27/A/D/G/tau
A svn-test-work/working_copies/diff_tests-27/A/D/H
A svn-test-work/working_copies/diff_tests-27/A/D/H/chi
A svn-test-work/working_copies/diff_tests-27/A/D/H/omega
A svn-test-work/working_copies/diff_tests-27/A/D/H/psi
A svn-test-work/working_copies/diff_tests-27/iota
Checked out revision 1.
CMD: svn add foo --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.459427>
A foo
CMD: svn ci -m "log msg r2" --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.598772>
Adding foo
Transmitting file data .
Committed revision 2.
CMD: svn ci -m "log msg r3" --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.497885>
Sending foo
Transmitting file data .
Committed revision 3.
CMD: svn up --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.467105>
At revision 3.
CMD: svn rm foo --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.407663>
D foo
CMD: svn diff -r 1 --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.432545>
CMD: svn diff -r 1:BASE --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.367387>
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1,2 @@
+xxx
+yyy
EXPECTED STDOUT:
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 3)
@@ -0,0 +1,2 @@
+xxx
+yyy
ACTUAL STDOUT:
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1,2 @@
+xxx
+yyy
EXCEPTION: SVNLineUnequal
Traceback (most recent call last):
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/main.py", line 1172, in run
    rc = self.pred.run(sandbox)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/testcase.py", line 146, in run
    return self.func(sandbox)
  File "./diff_tests.py", line 2031, in diff_schedule_delete
    'diff', '-r', '1:BASE')
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 207, in run_and_verify_svn
    expected_exit, *varargs)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 241, in run_and_verify_svn2
    verify.verify_outputs(message, out, err, expected_stdout, expected_stderr)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 363, in verify_outputs
    compare_and_display_lines(message, label, expected, actual, raisable)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 336, in compare_and_display_lines
    raise raisable
SVNLineUnequal
FAIL: diff_tests.py 27: scheduled deleted
CMD: svnadmin create svn-test-work/repositories/diff_tests-32 --bdb-txn-nosync
<TIME = 0.190809>
CMD: svnadmin dump svn-test-work/local_tmp/repos | svnadmin load svn-test-work/repositories/diff_tests-32 --ignore-uuid
<TIME = 0.264138>
CMD: svn co file:///home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/repositories/diff_tests-32 svn-test-work/working_copies/diff_tests-32 --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.698848>
A svn-test-work/working_copies/diff_tests-32/A
A svn-test-work/working_copies/diff_tests-32/A/B
A svn-test-work/working_copies/diff_tests-32/A/B/lambda
A svn-test-work/working_copies/diff_tests-32/A/B/E
A svn-test-work/working_copies/diff_tests-32/A/B/E/alpha
A svn-test-work/working_copies/diff_tests-32/A/B/E/beta
A svn-test-work/working_copies/diff_tests-32/A/B/F
A svn-test-work/working_copies/diff_tests-32/A/mu
A svn-test-work/working_copies/diff_tests-32/A/C
A svn-test-work/working_copies/diff_tests-32/A/D
A svn-test-work/working_copies/diff_tests-32/A/D/gamma
A svn-test-work/working_copies/diff_tests-32/A/D/G
A svn-test-work/working_copies/diff_tests-32/A/D/G/pi
A svn-test-work/working_copies/diff_tests-32/A/D/G/rho
A svn-test-work/working_copies/diff_tests-32/A/D/G/tau
A svn-test-work/working_copies/diff_tests-32/A/D/H
A svn-test-work/working_copies/diff_tests-32/A/D/H/chi
A svn-test-work/working_copies/diff_tests-32/A/D/H/omega
A svn-test-work/working_copies/diff_tests-32/A/D/H/psi
A svn-test-work/working_copies/diff_tests-32/iota
Checked out revision 1.
CMD: svn add X foo --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.363076>
A X
A X/bar
A foo
CMD: svn ci -m log_msg --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.513199>
Adding X
Adding X/bar
Adding foo
Transmitting file data ..
Committed revision 2.
CMD: svn propset propname propvalue X foo X/bar --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.364929>
property 'propname' set on 'X'
property 'propname' set on 'foo'
property 'propname' set on 'X/bar'
CMD: svn ci -m log_msg --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.506115>
Sending X
Sending X/bar
Sending foo

Committed revision 3.
CMD: svn diff -r 1 --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.456476>

Property changes on: X
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 1)
@@ -0,0 +1 @@
+content

Property changes on: X/bar
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1 @@
+content

Property changes on: foo
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
EXPECTED STDOUT:

Property changes on: X
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 3)
@@ -0,0 +1 @@
+content

Property changes on: X/bar
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 3)
@@ -0,0 +1 @@
+content

Property changes on: foo
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
ACTUAL STDOUT:

Property changes on: X
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 1)
@@ -0,0 +1 @@
+content

Property changes on: X/bar
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 1)
@@ -0,0 +1 @@
+content

Property changes on: foo
___________________________________________________________________
Added: propname
## -0,0 +1 ##
+propvalue
EXCEPTION: SVNLineUnequal
Traceback (most recent call last):
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/main.py", line 1172, in run
    rc = self.pred.run(sandbox)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/testcase.py", line 146, in run
    return self.func(sandbox)
  File "./diff_tests.py", line 2250, in diff_repos_wc_add_with_props
    'diff', '-r', '1')
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 207, in run_and_verify_svn
    expected_exit, *varargs)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 241, in run_and_verify_svn2
    verify.verify_outputs(message, out, err, expected_stdout, expected_stderr)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 363, in verify_outputs
    compare_and_display_lines(message, label, expected, actual, raisable)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 336, in compare_and_display_lines
    raise raisable
SVNLineUnequal
FAIL: diff_tests.py 32: repos-wc diff showing added entries with props
CMD: svnadmin create svn-test-work/repositories/diff_tests-34 --bdb-txn-nosync
<TIME = 0.200476>
CMD: svnadmin dump svn-test-work/local_tmp/repos | svnadmin load svn-test-work/repositories/diff_tests-34 --ignore-uuid
<TIME = 0.240093>
CMD: svn co file:///home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/repositories/diff_tests-34 svn-test-work/working_copies/diff_tests-34 --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.631497>
A svn-test-work/working_copies/diff_tests-34/A
A svn-test-work/working_copies/diff_tests-34/A/B
A svn-test-work/working_copies/diff_tests-34/A/B/lambda
A svn-test-work/working_copies/diff_tests-34/A/B/E
A svn-test-work/working_copies/diff_tests-34/A/B/E/alpha
A svn-test-work/working_copies/diff_tests-34/A/B/E/beta
A svn-test-work/working_copies/diff_tests-34/A/B/F
A svn-test-work/working_copies/diff_tests-34/A/mu
A svn-test-work/working_copies/diff_tests-34/A/C
A svn-test-work/working_copies/diff_tests-34/A/D
A svn-test-work/working_copies/diff_tests-34/A/D/gamma
A svn-test-work/working_copies/diff_tests-34/A/D/G
A svn-test-work/working_copies/diff_tests-34/A/D/G/pi
A svn-test-work/working_copies/diff_tests-34/A/D/G/rho
A svn-test-work/working_copies/diff_tests-34/A/D/G/tau
A svn-test-work/working_copies/diff_tests-34/A/D/H
A svn-test-work/working_copies/diff_tests-34/A/D/H/chi
A svn-test-work/working_copies/diff_tests-34/A/D/H/omega
A svn-test-work/working_copies/diff_tests-34/A/D/H/psi
A svn-test-work/working_copies/diff_tests-34/iota
Checked out revision 1.
CMD: svn add X --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.331853>
A X
A X/bar
CMD: svn ci -m log_msg --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.448988>
Adding X
Adding X/bar
Transmitting file data .
Committed revision 2.
CMD: svn diff -r 1:BASE --config-dir /home/stsp/svn/svn-trunk/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.356167>
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 1)
@@ -0,0 +1 @@
+content
EXPECTED STDOUT:
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 2)
@@ -0,0 +1 @@
+content
ACTUAL STDOUT:
Index: X/bar
===================================================================
--- X/bar (revision 0)
+++ X/bar (revision 1)
@@ -0,0 +1 @@
+content
EXCEPTION: SVNLineUnequal
Traceback (most recent call last):
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/main.py", line 1172, in run
    rc = self.pred.run(sandbox)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/testcase.py", line 146, in run
    return self.func(sandbox)
  File "./diff_tests.py", line 2330, in diff_repos_working_added_dir
    'diff', '-r', '1:BASE')
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 207, in run_and_verify_svn
    expected_exit, *varargs)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 241, in run_and_verify_svn2
    verify.verify_outputs(message, out, err, expected_stdout, expected_stderr)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 363, in verify_outputs
    compare_and_display_lines(message, label, expected, actual, raisable)
  File "/home/stsp/svn/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 336, in compare_and_display_lines
    raise raisable
SVNLineUnequal
FAIL: diff_tests.py 34: repos->WORKING diff showing added modifed dir

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2408694
Received on 2009-10-18 21:13:23 CEST

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