Author: svn-role
Date: Thu May 16 04:01:25 2013
New Revision: 1483186
URL: http://svn.apache.org/r1483186
Log:
Merge the r1482969 group from trunk:
* r1482969, r1482970
Fix issue #4366 ("client SEGFAULTs diffing a repos rev in which an
empty file was added").
Justification:
SEGFAULTs are consider rude in polite company.
Votes:
+1: cmpilato, philip, rhuijben
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/subversion/libsvn_client/repos_diff.c
subversion/branches/1.8.x/subversion/tests/cmdline/diff_tests.py
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1482969-1482970
Modified: subversion/branches/1.8.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1483186&r1=1483185&r2=1483186&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu May 16 04:01:25 2013
@@ -135,14 +135,6 @@ Approved changes:
# blocking issues. If in doubt see this link for details:
#
http://subversion.apache.org/docs/community-guide/releasing.html#release-stabilization
- * r1482969, r1482970
- Fix issue #4366 ("client SEGFAULTs diffing a repos rev in which an
- empty file was added").
- Justification:
- SEGFAULTs are consider rude in polite company.
- Votes:
- +1: cmpilato, philip, rhuijben
-
* r1482973
Avoid using predictable temporary filenames based on "tempfile".
Justification:
Modified: subversion/branches/1.8.x/subversion/libsvn_client/repos_diff.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/repos_diff.c?rev=1483186&r1=1483185&r2=1483186&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/repos_diff.c Thu May 16
04:01:25 2013
@@ -933,12 +933,12 @@ apply_textdelta(void *file_baton,
}
/* Open the file to be used as the base for second revision */
- src_stream = svn_stream_lazyopen_create(lazy_open_source, fb, FALSE,
+ src_stream = svn_stream_lazyopen_create(lazy_open_source, fb, TRUE,
scratch_pool);
/* Open the file that will become the second revision after applying the
text delta, it starts empty */
- result_stream = svn_stream_lazyopen_create(lazy_open_result, fb, FALSE,
+ result_stream = svn_stream_lazyopen_create(lazy_open_result, fb, TRUE,
scratch_pool);
svn_txdelta_apply(src_stream,
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=1483186&r1=1483185&r2=1483186&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 May 16
04:01:25 2013
@@ -4520,6 +4520,36 @@ def diff_dir_replaced_by_dir(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--summarize', wc_dir)
+
+@Issue(4366)
+def diff_repos_empty_file_addition(sbox):
+ "repos diff of rev which adds empty file"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Add and commit an empty file.
+ svntest.main.file_append(sbox.ospath('newfile'), "")
+ svntest.main.run_svn(None, 'add', sbox.ospath('newfile'))
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'newfile': Item(verb='Adding'),
+ })
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ expected_status.add({
+ 'newfile' : Item(status=' ', wc_rev=2),
+ })
+ svntest.actions.run_and_verify_commit(sbox.wc_dir, expected_output,
+ expected_status, None, sbox.wc_dir)
+
+ # Now diff the revision that added the empty file.
+ expected_output = [
+ 'Index: newfile\n',
+ '===================================================================\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', '-c', '2', sbox.repo_url)
+
+
########################################################################
#Run the tests
@@ -4598,6 +4628,7 @@ test_list = [ None,
local_tree_replace,
diff_dir_replaced_by_file,
diff_dir_replaced_by_dir,
+ diff_repos_empty_file_addition,
]
if __name__ == '__main__':