Modified: subversion/branches/atomic-revprop/subversion/libsvn_repos/load.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_repos/load.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/libsvn_repos/load.c (original) +++ subversion/branches/atomic-revprop/subversion/libsvn_repos/load.c Thu Aug 5 20:56:19 2010 @@ -280,11 +280,36 @@ renumber_mergeinfo_revs(svn_string_t **f apr_pool_t *pool) { apr_pool_t *subpool = svn_pool_create(pool); - apr_hash_t *mergeinfo; - apr_hash_t *final_mergeinfo = apr_hash_make(subpool); + svn_mergeinfo_t mergeinfo, predates_stream_mergeinfo; + svn_mergeinfo_t final_mergeinfo = apr_hash_make(subpool); apr_hash_index_t *hi; SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool)); + + /* Issue #3020 + http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16 + Remove mergeinfo older than the oldest revision in the dump stream + and adjust its revisions by the difference between the head rev of + the target repository and the current dump stream rev. */ + if (rb->pb->oldest_old_rev > 1) + { + SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges( + &predates_stream_mergeinfo, mergeinfo, + rb->pb->oldest_old_rev - 1, 0, + TRUE, subpool, subpool)); + SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges( + &mergeinfo, mergeinfo, + rb->pb->oldest_old_rev - 1, 0, + FALSE, subpool, subpool)); + SVN_ERR(svn_mergeinfo__adjust_mergeinfo_rangelists( + &predates_stream_mergeinfo, predates_stream_mergeinfo, + -rb->rev_offset, subpool, subpool)); + } + else + { + predates_stream_mergeinfo = NULL; + } + for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi)) { const char *merge_source; @@ -350,6 +375,11 @@ renumber_mergeinfo_revs(svn_string_t **f apr_hash_set(final_mergeinfo, merge_source, APR_HASH_KEY_STRING, rangelist); } + + if (predates_stream_mergeinfo) + SVN_ERR(svn_mergeinfo_merge(final_mergeinfo, predates_stream_mergeinfo, + subpool)); + SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool)); /* Mergeinfo revision sources for r0 and r1 are invalid; you can't merge r0 @@ -1059,6 +1089,10 @@ new_revision_record(void **revision_bato pb->notify->old_revision = rb->rev; pb->notify_func(pb->notify_baton, pb->notify, rb->pool); } + + /* Stash the oldest "old" revision committed from the load stream. */ + if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev)) + pb->oldest_old_rev = rb->rev; } /* If we're parsing revision 0, only the revision are (possibly) @@ -1416,10 +1450,6 @@ close_revision(void *baton) return svn_error_return(err); } - /* Stash the oldest "old" revision committed from the load stream. */ - if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev)) - pb->oldest_old_rev = *old_rev; - /* Run post-commit hook, if so commanded. */ if (pb->use_post_commit_hook) {
Modified: subversion/branches/atomic-revprop/subversion/libsvn_subr/mergeinfo.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_subr/mergeinfo.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/libsvn_subr/mergeinfo.c (original) +++ subversion/branches/atomic-revprop/subversion/libsvn_subr/mergeinfo.c Thu Aug 5 20:56:19 2010 @@ -2090,6 +2090,58 @@ svn_mergeinfo__filter_mergeinfo_by_range return SVN_NO_ERROR; } +svn_error_t * +svn_mergeinfo__adjust_mergeinfo_rangelists(svn_mergeinfo_t *adjusted_mergeinfo, + svn_mergeinfo_t mergeinfo, + svn_revnum_t offset, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + apr_hash_index_t *hi; + *adjusted_mergeinfo = apr_hash_make(result_pool); + + if (mergeinfo) + { + for (hi = apr_hash_first(scratch_pool, mergeinfo); + hi; + hi = apr_hash_next(hi)) + { + int i; + const char *path = svn__apr_hash_index_key(hi); + apr_array_header_t *rangelist = svn__apr_hash_index_val(hi); + apr_array_header_t *adjusted_rangelist = + apr_array_make(result_pool, rangelist->nelts, + sizeof(svn_merge_range_t *)); + + for (i = 0; i < rangelist->nelts; i++) + { + svn_merge_range_t *range = + APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *); + + if (range->start + offset > 0 && range->end + offset > 0) + { + if (range->start + offset < 0) + range->start = 0; + else + range->start = range->start + offset; + + if (range->end + offset < 0) + range->end = 0; + else + range->end = range->end + offset; + APR_ARRAY_PUSH(adjusted_rangelist, svn_merge_range_t *) = + range; + } + } + + if (adjusted_rangelist->nelts) + apr_hash_set(*adjusted_mergeinfo, apr_pstrdup(result_pool, path), + APR_HASH_KEY_STRING, adjusted_rangelist); + } + } + return SVN_NO_ERROR; +} + svn_boolean_t svn_mergeinfo__is_noninheritable(svn_mergeinfo_t mergeinfo, apr_pool_t *scratch_pool) Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c (original) +++ subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c Thu Aug 5 20:56:19 2010 @@ -2343,8 +2343,11 @@ svn_wc_props_modified_p(svn_boolean_t *m local_abspath, pool); - if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) + if (err) { + if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND) + return svn_error_return(err); + svn_error_clear(err); *modified_p = FALSE; } Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original) +++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Thu Aug 5 20:56:19 2010 @@ -2433,7 +2433,6 @@ svn_wc__db_pristine_get_path(const char VERIFY_USABLE_PDH(pdh); SVN_ERR(svn_wc__db_pristine_check(&present, db, wri_abspath, sha1_checksum, - svn_wc__db_checkmode_usable, scratch_pool)); if (! present) return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL, @@ -2815,7 +2814,6 @@ svn_wc__db_pristine_check(svn_boolean_t svn_wc__db_t *db, const char *wri_abspath, const svn_checksum_t *sha1_checksum, - svn_wc__db_checkmode_t mode, apr_pool_t *scratch_pool) { svn_wc__db_pdh_t *pdh; Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h (original) +++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h Thu Aug 5 20:56:19 2010 @@ -857,53 +857,6 @@ svn_wc__db_base_clear_dav_cache_recursiv @{ */ -/* Enumerated constants for how hard svn_wc__db_pristine_check() should - work on checking for the pristine file. -*/ -typedef enum { - - /* ### bah. this is bogus. we open the sqlite database "all the time", - ### and don't worry about optimizing that. so: given the db is always - ### open, then the following modes are overengineered, premature - ### optimizations. ... will clean up in a future rev. */ - - /* The caller wants to be sure the pristine file is present and usable. - This is the typical mode to use. - - Implementation note: the SQLite database is opened (if not already) - and its state is verified against the file in the filesystem. */ - svn_wc__db_checkmode_usable, - - /* The caller is performing just this one check. The implementation will - optimize around the assumption no further calls to _check() will occur - (but of course has no problem if they do). - - Note: this test is best used for detecting a *missing* file - rather than for detecting a usable file. - - Implementation note: this will examine the presence of the pristine file - in the filesystem. The SQLite database is untouched, though if it is - (already) open, then it will be used instead. */ - svn_wc__db_checkmode_single, - - /* The caller is going to perform multiple calls, so the implementation - should optimize its operation around that. - - Note: this test is best used for detecting a *missing* file - rather than for detecting a usable file. - - Implementation note: the SQLite database will be opened (if not already), - and all checks will simply look in the TEXT_BASE table to see if the - given key is present. Note that the file may not be present. */ - svn_wc__db_checkmode_multi, - - /* Similar to _usable, but the file is checksum'd to ensure that it has - not been corrupted in some way. */ - svn_wc__db_checkmode_validate - -} svn_wc__db_checkmode_t; - - /* Set *PRISTINE_ABSPATH to the path to the pristine text file identified by SHA1_CHECKSUM. Error if it does not exist. @@ -1023,15 +976,14 @@ svn_wc__db_pristine_cleanup(svn_wc__db_t apr_pool_t *scratch_pool); -/* ### check for presence, according to the given mode (on how hard we - ### should examine things) +/* Set *PRESENT to true if the pristine store for WRI_ABSPATH in DB contains + a pristine text with SHA-1 checksum SHA1_CHECKSUM, and to false otherwise. */ svn_error_t * svn_wc__db_pristine_check(svn_boolean_t *present, svn_wc__db_t *db, const char *wri_abspath, const svn_checksum_t *sha1_checksum, - svn_wc__db_checkmode_t mode, apr_pool_t *scratch_pool); Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/export_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/export_tests.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/export_tests.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/export_tests.py Thu Aug 5 20:56:19 2010 @@ -26,6 +26,7 @@ # General modules import os +import tempfile # Our testing module import svntest @@ -550,6 +551,76 @@ def export_working_copy_with_depths(sbox expected_disk, '--depth=empty') +def export_externals_with_native_eol(sbox): + "export externals with eol translation" + sbox.build() + + wc_dir = sbox.wc_dir + + # Set svn:eol-style to 'native' to see if it's applied correctly to + # externals in the export operation + alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha') + svntest.main.run_svn(None, 'ps', 'svn:eol-style', 'native', alpha_path) + svntest.main.run_svn(None, 'ci', + '-m', 'Added eol-style prop to alpha', alpha_path) + + # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external), + # 'A/B/E'(directory external) & commit the property + C_path = os.path.join(wc_dir, 'A', 'C') + externals_prop = """^/A/B/E/alpha exfile_alpha + ^/A/B/E exdir_E""" + + tmp_f = sbox.get_tempname('props') + svntest.main.file_append(tmp_f, externals_prop) + svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path) + svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path) + + + # Update the working copy to receive all changes(file external and + # directroy external changes) from repository + svntest.main.run_svn(None, 'up', wc_dir) + + # After export, expected_disk will have all those present in standard + # greek tree and new externals we added above. + # Update the expected disk tree to include all those externals. + expected_disk = svntest.main.greek_state.copy() + expected_disk.add({ + 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\n"), + 'A/C/exdir_E' : Item(), + 'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\n"), + 'A/C/exdir_E/beta' : Item("This is the file 'beta'.\n") + }) + + # We are exporting with '--native-eol CR' option. + # So change the contents of files under *expected_disk* tree + # which have svn:eol-style property set to 'native' to verify + # with the exported tree. + # Here A/B/E/alpha and its external manifestations A/C/exfile_alpha + # and A/C/exdir_E/alpha needs a tweak. + new_contents = expected_disk.desc['A/C/exfile_alpha'].contents.replace("\n", + "\r") + expected_disk.tweak('A/C/exfile_alpha', 'A/B/E/alpha','A/C/exdir_E/alpha', + contents=new_contents) + + expected_output = svntest.main.greek_state.copy() + expected_output.add({ + 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"), + 'A/C/exdir_E' : Item(), + 'A/C/exdir_E/alpha' : Item("This is the file 'alpha'.\r"), + 'A/C/exdir_E/beta' : Item("This is the file 'beta'.\n") + }) + + # Export the repository with '--native-eol CR' option + export_target = sbox.add_wc_path('export') + expected_output.wc_dir = export_target + expected_output.desc[''] = Item() + expected_output.tweak(contents=None, status='A ') + svntest.actions.run_and_verify_export(sbox.repo_url, + export_target, + expected_output, + expected_disk, + '--native-eol', 'CR') + ######################################################################## # Run the tests @@ -578,6 +649,7 @@ test_list = [ None, export_working_copy_ignoring_keyword_translation, export_with_url_unsafe_characters, XFail(export_working_copy_with_depths), + export_externals_with_native_eol, ] if __name__ == '__main__': Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_authz_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_authz_tests.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_authz_tests.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_authz_tests.py Thu Aug 5 20:56:19 2010 @@ -442,7 +442,6 @@ def mergeinfo_and_skipped_paths(sbox): }) expected_skip = wc.State(A_COPY_2_H_path, {}) saved_cwd = os.getcwd() - #raise svntest.Failure("PTB") svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '7', '9', sbox.repo_url + '/A/D/H', None, expected_output, Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/svnadmin_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/svnadmin_tests.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/svnadmin_tests.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/svnadmin_tests.py Thu Aug 5 20:56:19 2010 @@ -1162,28 +1162,7 @@ def dont_drop_valid_mergeinfo_during_inc # Check the resulting mergeinfo. We expect the exact same results # as Part 3. - # - # Currently this fails because our current logic mapping mergeinfo revs - # in the load stream to their new values based on the offset of the - # target repository is quite flawed. Right now this is the resulting - # mergeinfo: - # - # Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B1\B - # svn:mergeinfo - # /Projects/Project-X/branches/B2/B/E:11-12 - # /Projects/Project-X/trunk/B/E:5-6,8-9 - # Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B1': - # svn:mergeinfo - # /Projects/Project-X/branches/B2:11-18 - # ^^ - # The *only* correct rev here! - # /Projects/Project-X/trunk:6,9 - # Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B2': - # svn:mergeinfo - # /Projects/Project-X/trunk:9 - # - # See http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16 for - # more info. + # See http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16. svntest.actions.run_and_verify_svn(None, expected_output, [], 'propget', 'svn:mergeinfo', '-R', sbox.repo_url) @@ -1276,7 +1255,7 @@ test_list = [ None, create_in_repo_subdir, SkipUnless(verify_with_invalid_revprops, svntest.main.is_fs_type_fsfs), - XFail(dont_drop_valid_mergeinfo_during_incremental_loads), + dont_drop_valid_mergeinfo_during_incremental_loads, SkipUnless(hotcopy_symlink, svntest.main.is_posix_os), ] Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py Thu Aug 5 20:56:19 2010 @@ -175,8 +175,8 @@ test_list = [ None, basic_dump, revision_0_dump, revision_0_load, - Wimp("Need to interpret response 501", skeleton_load, - svntest.main.is_ra_type_dav), + XFail(XFail(skeleton_load, svntest.main.is_ra_type_dav), + svntest.main.is_ra_type_svn), Wimp("Need to interpret response 501", copy_and_modify_load, svntest.main.is_ra_type_dav), Wimp("Need to fix headers in RA layer", copy_and_modify_dump), Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/svntest/sandbox.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/svntest/sandbox.py Thu Aug 5 20:56:19 2010 @@ -133,6 +133,20 @@ class Sandbox: self.add_test_path(path, remove) return path + tempname_offs = 0 # Counter for get_tempname + + def get_tempname(self, prefix='tmp'): + """Get a stable name for a temporary file that will be removed after + running the test""" + + dir = self.add_wc_path('tmp') + if not os.path.exists(dir): + os.mkdir(dir) + + self.tempname_offs = self.tempname_offs + 1 + + return os.path.join(dir, '%s-%s' % (prefix, self.tempname_offs)) + def cleanup_test_paths(self): "Clean up detritus from this sandbox, and any dependents." if self.dependents: Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py (original) +++ subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py Thu Aug 5 20:56:19 2010 @@ -5582,6 +5582,49 @@ def mergeinfo_updates_merge_with_local_m 'pg', SVN_PROP_MERGEINFO, '-R', A_COPY_path) +#---------------------------------------------------------------------- +# Test for receiving modified properties on added files that were originally +# moved from somewhere else. (Triggers locate_copyfrom behavior) +def add_moved_file_has_props(sbox): + """update adding moved file receives modified props""" + sbox.build() + + wc_dir = sbox.wc_dir + + G = os.path.join(os.path.join(wc_dir, 'A', 'D', 'G')) + pi = os.path.join(G, 'pi') + G_new = os.path.join(wc_dir, 'G_new') + + # Give pi some property + svntest.main.run_svn(None, 'ps', 'svn:eol-style', 'native', pi) + svntest.main.run_svn(None, 'ci', wc_dir, '-m', 'added eol-style') + + svntest.actions.run_and_verify_svn(None, 'At revision 2.', [], 'up', wc_dir) + + # Now move pi to a different place + svntest.main.run_svn(None, 'mkdir', G_new) + svntest.main.run_svn(None, 'mv', pi, G_new) + svntest.main.run_svn(None, 'ci', wc_dir, '-m', 'Moved pi to G_new') + + svntest.actions.run_and_verify_svn(None, 'At revision 3.', [], 'up', wc_dir) + + + expected_status = svntest.actions.get_virginal_state(wc_dir, 3) + expected_status.remove('A/D/G/pi') + expected_status.add({ + 'G_new' : Item (status=' ', wc_rev=3), + 'G_new/pi' : Item (status=' ', wc_rev=3), + }) + + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + svntest.main.run_svn(None, 'up', '-r', '0', G_new) + svntest.main.run_svn(None, 'up', wc_dir) + + # This shouldn't show property modifications, but at r982550 it did. + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + ####################################################################### # Run the tests @@ -5650,6 +5693,7 @@ test_list = [ None, XFail(update_deleted_locked_files), XFail(update_empty_hides_entries), mergeinfo_updates_merge_with_local_mods, + XFail(add_moved_file_has_props), ] if __name__ == '__main__': Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c (original) +++ subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c Thu Aug 5 20:56:19 2010 @@ -86,17 +86,37 @@ static const char *git_tree_and_text_uni "git --diff a/iota b/iota.copied" NL "copy from iota" NL "copy to iota.copied" NL + "--- a/iota\t(revision 2)" NL + "+++ b/iota.copied\t(working copy)" NL "@@ -1 +1,2 @@" NL " This is the file 'iota'." NL "+some more bytes to 'iota'" NL "Index: A/mu.moved" NL "===================================================================" NL "git --diff a/A/mu b/A/mu.moved" NL - "move from A/mu" NL - "move to A/mu.moved" NL + "rename from A/mu" NL + "rename to A/mu.moved" NL + "--- a/A/mu\t(revision 2)" NL + "+++ b/A/mu.moved\t(working copy)" NL "@@ -1 +1,2 @@" NL " This is the file 'mu'." NL "+some more bytes to 'mu'" NL + "Index: new" NL + "===================================================================" NL + "git --diff a/new b/new" NL + "new file mode 100644" NL + "--- /dev/null\t(revision 0)" NL + "+++ b/new\t(working copy)" NL + "@@ -0,0 +1 @@" NL + "+This is the file 'new'." NL + "Index: A/B/lambda" NL + "===================================================================" NL + "git --diff a/A/B/lambda b/A/B/lambda" NL + "deleted file mode 100644" NL + "--- a/A/B/lambda\t(revision 2)" NL + "+++ /dev/null\t(working copy)" NL + "@@ -1 +0,0 @@" NL + "-This is the file 'lambda'." NL "" NL; /* Only the last git diff header is valid. The other ones either misses a @@ -220,9 +240,9 @@ static const char *bad_git_diff_header = "new file mode 100644" NL "git --diff a/path one 1 b/path one 1" NL "new file mode 100644" NL - "git --diff a/dir/b/path b/dir/b/path" NL + "git --diff a/dir/ b/path b/dir/ b/path" NL "new file mode 100644" NL - "git --diff a/b/path 1 b/b/path 1" NL + "git --diff a/ b/path 1 b/ b/path 1" NL "new file mode 100644" NL; @@ -500,6 +520,45 @@ test_parse_git_tree_and_text_diff(apr_po "some more bytes to 'mu'" NL, pool)); + SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, + FALSE, /* reverse */ + FALSE, /* ignore_whitespace */ + pool, pool)); + SVN_TEST_ASSERT(patch); + SVN_TEST_ASSERT(! strcmp(patch->old_filename, "/dev/null")); + SVN_TEST_ASSERT(! strcmp(patch->new_filename, "new")); + SVN_TEST_ASSERT(patch->operation == svn_diff_op_added); + SVN_TEST_ASSERT(patch->hunks->nelts == 1); + + hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "", + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "This is the file 'new'." NL, + pool)); + + SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, + FALSE, /* reverse */ + FALSE, /* ignore_whitespace */ + pool, pool)); + SVN_TEST_ASSERT(patch); + SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/B/lambda")); + SVN_TEST_ASSERT(! strcmp(patch->new_filename, "/dev/null")); + SVN_TEST_ASSERT(patch->operation == svn_diff_op_deleted); + SVN_TEST_ASSERT(patch->hunks->nelts == 1); + + hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "This is the file 'lambda'." NL, + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "", + pool)); return SVN_NO_ERROR; } @@ -834,8 +893,8 @@ test_git_diffs_with_spaces_diff(apr_pool FALSE, /* ignore_whitespace */ pool, pool)); SVN_TEST_ASSERT(patch); - SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/b/path")); - SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/b/path")); + SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/ b/path")); + SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/ b/path")); SVN_TEST_ASSERT(patch->operation == svn_diff_op_added); SVN_TEST_ASSERT(patch->hunks->nelts == 0); @@ -844,8 +903,8 @@ test_git_diffs_with_spaces_diff(apr_pool FALSE, /* ignore_whitespace */ pool, pool)); SVN_TEST_ASSERT(patch); - SVN_TEST_ASSERT(! strcmp(patch->old_filename, "b/path 1")); - SVN_TEST_ASSERT(! strcmp(patch->new_filename, "b/path 1")); + SVN_TEST_ASSERT(! strcmp(patch->old_filename, " b/path 1")); + SVN_TEST_ASSERT(! strcmp(patch->new_filename, " b/path 1")); SVN_TEST_ASSERT(patch->operation == svn_diff_op_added); SVN_TEST_ASSERT(patch->hunks->nelts == 0); @@ -861,7 +920,7 @@ struct svn_test_descriptor_t test_funcs[ SVN_TEST_PASS2(test_parse_git_diff, "test git unidiff parsing"), SVN_TEST_PASS2(test_parse_git_tree_and_text_diff, - "test git unidiff parsing of tree and text changes"), + "test git unidiff parsing of tree and text changes"), SVN_TEST_XFAIL2(test_bad_git_diff_headers, "test badly formatted git diff headers"), SVN_TEST_PASS2(test_parse_property_diff, @@ -870,7 +929,7 @@ struct svn_test_descriptor_t test_funcs[ "test property and text unidiff parsing"), SVN_TEST_PASS2(test_parse_diff_symbols_in_prop_unidiff, "test property diffs with odd symbols"), - SVN_TEST_XFAIL2(test_git_diffs_with_spaces_diff, + SVN_TEST_PASS2(test_git_diffs_with_spaces_diff, "test git diffs with spaces in paths"), SVN_TEST_NULL }; Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/pristine-store-test.c URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/pristine-store-test.c?rev=982782&r1=982781&r2=982782&view=diff ============================================================================== --- subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/pristine-store-test.c (original) +++ subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/pristine-store-test.c Thu Aug 5 20:56:19 2010 @@ -162,7 +162,7 @@ pristine_write_read(const svn_test_opts_ svn_boolean_t present; SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1, - svn_wc__db_checkmode_usable, pool)); + pool)); SVN_ERR_ASSERT(! present); } @@ -175,7 +175,7 @@ pristine_write_read(const svn_test_opts_ svn_boolean_t present; SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1, - svn_wc__db_checkmode_usable, pool)); + pool)); SVN_ERR_ASSERT(present); } @@ -220,7 +220,7 @@ pristine_write_read(const svn_test_opts_ svn_boolean_t present; SVN_ERR(svn_wc__db_pristine_check(&present, db, wc_abspath, data_sha1, - svn_wc__db_checkmode_usable, pool)); + pool)); SVN_ERR_ASSERT(! present); }
