Author: svn-role
Date: Wed May 22 04:02:15 2013
New Revision: 1485052

URL: http://svn.apache.org/r1485052
Log:
Merge the r1483391 group from trunk:

 * r1483391, r1483397
   Fix 'svn diff' erroring out on missing tree conflict victims.
   Justification:
     Regresion from 1.7.
   Votes:
     +1: stsp, rhuijben, pburba

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c
    subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1483391,1483397

Modified: subversion/branches/1.8.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1485052&r1=1485051&r2=1485052&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed May 22 04:02:15 2013
@@ -143,13 +143,6 @@ Approved changes:
 # blocking issues.  If in doubt see this link for details:
 # 
http://subversion.apache.org/docs/community-guide/releasing.html#release-stabilization
 
- * r1483391, r1483397
-   Fix 'svn diff' erroring out on missing tree conflict victims.
-   Justification:
-     Regresion from 1.7.
-   Votes:
-     +1: stsp, rhuijben, pburba
-
  * r1482829
    Reduce diskspace needed by our testsuite when using cleanup mode.
    Justification:

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c?rev=1485052&r1=1485051&r2=1485052&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/diff_local.c Wed May 22 
04:02:15 2013
@@ -201,6 +201,15 @@ diff_status_callback(void *baton,
       case svn_wc_status_ignored:
         return SVN_NO_ERROR; /* No diff */
 
+      case svn_wc_status_conflicted:
+        if (status->text_status == svn_wc_status_none
+            && status->prop_status == svn_wc_status_none)
+          {
+            /* Node is an actual only node describing a tree conflict */
+            return SVN_NO_ERROR;
+          }
+        break;
+
       default:
         break; /* Go check other conditions */
     }

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py?rev=1485052&r1=1485051&r2=1485052&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py Wed May 22 
04:02:15 2013
@@ -32,7 +32,7 @@ logger = logging.getLogger()
 
 # Our testing module
 import svntest
-from svntest import err
+from svntest import err, wc
 
 from prop_tests import binary_mime_type_on_text_file_warning
 
@@ -4549,6 +4549,50 @@ def diff_repos_empty_file_addition(sbox)
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '-c', '2', sbox.repo_url)
 
+def diff_missing_tree_conflict_victim(sbox):
+  "diff with missing tree-conflict victim in wc"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Produce an 'incoming edit vs. local missing' tree conflict:
+  # r2: edit iota and commit the change
+  svntest.main.file_append(sbox.ospath('iota'), "This is a change to iota.\n")
+  sbox.simple_propset('k', 'v', 'A/C')
+  sbox.simple_commit()
+  # now remove iota
+  sbox.simple_rm('iota', 'A/C')
+  sbox.simple_commit()
+  # update to avoid mixed-rev wc warning
+  sbox.simple_update()
+  # merge r2 into wc and verify that a tree conflict is flagged on iota
+  expected_output = wc.State(wc_dir, {
+      'iota' : Item(status='  ', treeconflict='C'),
+      'A/C' : Item(status='  ', treeconflict='C')
+  })
+  expected_mergeinfo_output = wc.State(wc_dir, {})
+  expected_elision_output = wc.State(wc_dir, {})
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('iota','A/C')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+  expected_status.tweak('iota', 'A/C',
+                        status='! ', treeconflict='C', wc_rev=None)
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_merge(wc_dir, '1', '2',
+                                       sbox.repo_url, None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       None, None, None, None, None, None,
+                                       False, '--ignore-ancestry', wc_dir)
+
+  # 'svn diff' should show no change for the working copy
+  # This currently fails because svn errors out with a 'node not found' error
+  expected_output = [ ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir)
 
 ########################################################################
 #Run the tests
@@ -4629,6 +4673,7 @@ test_list = [ None,
               diff_dir_replaced_by_file,
               diff_dir_replaced_by_dir,
               diff_repos_empty_file_addition,
+              diff_missing_tree_conflict_victim,
               ]
 
 if __name__ == '__main__':


Reply via email to