You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/10/02 16:12:04 UTC
svn commit: r1706415 - in /subversion/trunk/subversion:
libsvn_client/patch.c tests/cmdline/patch_tests.py
Author: rhuijben
Date: Fri Oct 2 14:12:04 2015
New Revision: 1706415
URL: http://svn.apache.org/viewvc?rev=1706415&view=rev
Log:
Even on platforms that don't have native symlink support, use the proper
symlink functions to write symlinks.
This exposed a bug in the patch_symlink_add test where a symlink got an
extra newline attached.
* subversion/libsvn_client/patch.c
(resolve_target_path): Handle the local representation of symlinks on
platforms that we don't support real symlinks on.
* subversion/tests/cmdline/patch_tests.py
(patch_add_symlink): Our internal symlink format doesn't have an EOL.
Modified:
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/tests/cmdline/patch_tests.py
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1706415&r1=1706414&r2=1706415&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Fri Oct 2 14:12:04 2015
@@ -588,6 +588,22 @@ resolve_target_path(patch_target_t *targ
}
}
+#ifndef HAVE_SYMLINK
+ if (target->kind_on_disk == svn_node_file
+ && !target->is_symlink
+ && !target->locally_deleted
+ && status->prop_status != svn_wc_status_none)
+ {
+ const svn_string_t *value;
+
+ SVN_ERR(svn_wc_prop_get2(&value, wc_ctx, target->local_abspath,
+ SVN_PROP_SPECIAL, scratch_pool, scratch_pool));
+
+ if (value)
+ target->is_symlink = TRUE;
+ }
+#endif
+
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1706415&r1=1706414&r2=1706415&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Fri Oct 2 14:12:04 2015
@@ -3434,6 +3434,7 @@ def patch_add_symlink(sbox):
"+++ iota_symlink\t(working copy)\n",
"@@ -0,0 +1 @@\n",
"+link iota\n",
+ "\\ No newline at end of file\n"
"\n",
"Property changes on: iota_symlink\n",
"-------------------------------------------------------------------\n",
@@ -3453,7 +3454,7 @@ def patch_add_symlink(sbox):
expected_disk.add({'iota_symlink': Item(contents="This is the file 'iota'.\n",
props={'svn:special' : '*'})})
if not svntest.main.is_posix_os():
- expected_disk.tweak('iota_symlink', contents='link iota\n')
+ expected_disk.tweak('iota_symlink', contents='link iota')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.add({'iota_symlink': Item(status='A ', wc_rev='0')})