Author: svn-role
Date: Thu Aug 15 04:00:47 2013
New Revision: 1514152
URL: http://svn.apache.org/r1514152
Log:
Merge the r1504192 group from trunk:
* r1504192, r1504505
Make 'svn diff' continue on missing and obstructing files.
This resolves issue 4396
Justification:
Regression since 1.7.
Votes:
+1: philip, rhuijben, stefan2
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/subversion/libsvn_wc/diff_editor.c
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:r1504192,1504505
Modified: subversion/branches/1.8.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1514152&r1=1514151&r2=1514152&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu Aug 15 04:00:47 2013
@@ -230,11 +230,3 @@ Veto-blocked changes:
Approved changes:
=================
- * r1504192, r1504505
- Make 'svn diff' continue on missing and obstructing files.
- This resolves issue 4396
- Justification:
- Regression since 1.7.
- Votes:
- +1: philip, rhuijben, stefan2
-
Modified: subversion/branches/1.8.x/subversion/libsvn_wc/diff_editor.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/diff_editor.c?rev=1514152&r1=1514151&r2=1514152&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/diff_editor.c Thu Aug 15
04:00:47 2013
@@ -474,14 +474,18 @@ svn_wc__diff_base_working_diff(svn_wc__d
{
const svn_io_dirent2_t *dirent;
+ /* Verify truename to mimic status for iota/IOTA difference on Windows */
SVN_ERR(svn_io_stat_dirent2(&dirent, local_abspath,
- FALSE /* verify truename */,
+ TRUE /* verify truename */,
TRUE /* ingore_enoent */,
scratch_pool, scratch_pool));
- if (dirent->kind == svn_node_file
- && dirent->filesize == recorded_size
- && dirent->mtime == recorded_time)
+ /* If a file does not exist on disk (missing/obstructed) then we
+ can't provide a text diff */
+ if (dirent->kind != svn_node_file
+ || (dirent->kind == svn_node_file
+ && dirent->filesize == recorded_size
+ && dirent->mtime == recorded_time))
{
files_same = TRUE;
}
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=1514152&r1=1514151&r2=1514152&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 Thu Aug 15
04:00:47 2013
@@ -195,23 +195,15 @@ diff_status_callback(void *baton,
struct diff_baton *eb = baton;
svn_wc__db_t *db = eb->db;
- switch (status->node_status)
- {
- case svn_wc_status_unversioned:
- 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;
+ if (! status->versioned)
+ return SVN_NO_ERROR; /* unversioned (includes dir externals) */
- default:
- break; /* Go check other conditions */
+ if (status->node_status == svn_wc_status_conflicted
+ && 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;
}
/* Not text/prop modified, not copied. Easy out */
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=1514152&r1=1514151&r2=1514152&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 Thu Aug 15
04:00:47 2013
@@ -4594,6 +4594,60 @@ def diff_missing_tree_conflict_victim(sb
expected_output = [ ]
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir)
+@Issue(4396)
+def diff_local_missing_obstruction(sbox):
+ "diff local missing and obstructed files"
+
+ sbox.build(read_only=True)
+ wc_dir = sbox.wc_dir
+
+ os.unlink(sbox.ospath('iota'))
+ os.unlink(sbox.ospath('A/mu'))
+ os.mkdir(sbox.ospath('A/mu'))
+
+ # Expect no output for missing and obstructed files
+ expected_output = [
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir)
+
+ sbox.simple_propset('K', 'V', 'iota', 'A/mu')
+ sbox.simple_append('IotA', 'Content')
+
+ # But do expect a proper property diff
+ expected_output = [
+ 'Index: %s\n' % (sbox.path('A/mu'),),
+ '===================================================================\n',
+ '--- %s\t(revision 1)\n' % (sbox.path('A/mu'),),
+ '+++ %s\t(working copy)\n' % (sbox.path('A/mu'),),
+ '\n',
+ 'Property changes on: %s\n' % (sbox.path('A/mu'),),
+ '___________________________________________________________________\n',
+ 'Added: K\n',
+ '## -0,0 +1 ##\n',
+ '+V\n',
+ '\ No newline at end of property\n',
+ 'Index: %s\n' % (sbox.path('iota'),),
+ '===================================================================\n',
+ '--- %s\t(revision 1)\n' % (sbox.path('iota'),),
+ '+++ %s\t(working copy)\n' % (sbox.path('iota'),),
+ '\n',
+ 'Property changes on: %s\n' % (sbox.path('iota'),),
+ '___________________________________________________________________\n',
+ 'Added: K\n',
+ '## -0,0 +1 ##\n',
+ '+V\n',
+ '\ No newline at end of property\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir)
+
+ # Create an external. This produces an error in 1.8.0.
+ sbox.simple_propset('svn:externals', 'AA/BB ' + sbox.repo_url + '/A', '.')
+ sbox.simple_update()
+
+ svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
+ 'diff', wc_dir)
+
+
########################################################################
#Run the tests
@@ -4674,6 +4728,7 @@ test_list = [ None,
diff_dir_replaced_by_dir,
diff_repos_empty_file_addition,
diff_missing_tree_conflict_victim,
+ diff_local_missing_obstruction,
]
if __name__ == '__main__':