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 2011/04/08 16:44:12 UTC
svn commit: r1090281 - in /subversion/trunk/subversion: include/svn_wc.h
libsvn_client/update.c svn/notify.c tests/cmdline/update_tests.py
Author: rhuijben
Date: Fri Apr 8 14:44:12 2011
New Revision: 1090281
URL: http://svn.apache.org/viewvc?rev=1090281&view=rev
Log:
Following up on r1088837, revert to the old <=1.6 behavior where updating a
working only node doesn't produce an error to avoid breaking scripts that
pass multiple update targets. Do this by providing a proper skip notification.
* subversion/include/svn_wc.h
(svn_wc_notify_action_t): Add notification type.
* subversion/libsvn_client/update.c
(update_internal): Send a notification but return success, like how we
handled this in 1.6. (Well we did far more work, but with the same
result there).
* subversion/svn/notify.c
(notify): Add notification for working-only skips.
* subversion/svn/notify.c
(update_nonexistent_child_of_copy): Update test to parse the output and
check if the Skip is reported correctly.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/update.c
subversion/trunk/subversion/svn/notify.c
subversion/trunk/subversion/tests/cmdline/update_tests.py
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1090281&r1=1090280&r2=1090281&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Fri Apr 8 14:44:12 2011
@@ -1103,6 +1103,11 @@ typedef enum svn_wc_notify_action_t
* a separate working copy was found. @since New in 1.7. */
svn_wc_notify_update_skip_obstruction,
+ /** An explicit update tried to update a file or directory that
+ * doesn't live in the repository and can't be brought in.
+ * @since New in 1.7. */
+ svn_wc_notify_update_skip_working_only,
+
/** An update operation removed an external working copy.
* @since New in 1.7. */
svn_wc_notify_update_external_removed,
Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1090281&r1=1090280&r2=1090281&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Fri Apr 8 14:44:12 2011
@@ -118,13 +118,19 @@ update_internal(svn_revnum_t *result_rev
pool));
if (!SVN_IS_VALID_REVNUM(revnum))
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("'%s' does not exist in the repository yet,"
- " which makes it is impossible to update '%s'."),
- svn_dirent_local_style(anchor_abspath,
- pool),
- svn_dirent_basename(local_abspath, NULL));
+ {
+ if (ctx->notify_func2)
+ {
+ svn_wc_notify_t *nt;
+
+ nt = svn_wc_create_notify(local_abspath,
+ svn_wc_notify_update_skip_working_only,
+ pool);
+ ctx->notify_func2(ctx->notify_baton2, nt, pool);
+ }
+ return SVN_NO_ERROR;
+ }
/* We may need to crop the tree if the depth is sticky */
if (depth_is_sticky && depth < svn_depth_infinity)
Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=1090281&r1=1090280&r2=1090281&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Fri Apr 8 14:44:12 2011
@@ -156,6 +156,13 @@ notify(void *baton, const svn_wc_notify_
path_local)))
goto print_error;
break;
+ case svn_wc_notify_update_skip_working_only:
+ nb->skipped_paths++;
+ if ((err = svn_cmdline_printf(
+ pool, _("Skipped '%s' -- Has no versioned parent\n"),
+ path_local)))
+ goto print_error;
+ break;
case svn_wc_notify_update_delete:
case svn_wc_notify_update_external_removed:
nb->received_some_change = TRUE;
Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1090281&r1=1090280&r2=1090281&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Fri Apr 8 14:44:12 2011
@@ -5359,12 +5359,20 @@ def update_nonexistent_child_of_copy(sbo
svntest.main.run_svn(None, 'copy', 'A', 'A2')
# Try updating a nonexistent path in the copied dir.
- expected_error = "svn: E200009: '.*' does not exist in the repository yet"
- svntest.main.run_svn(expected_error, 'update', os.path.join('A2', 'nonexistent'))
+ expected_output = svntest.wc.State('A2', {
+ 'nonexistent' : Item(verb='Skipped'),
+ })
+ svntest.actions.run_and_verify_update(os.path.join('A2', 'nonexistent'),
+ expected_output, None, None, None)
# Try updating a deleted path in the copied dir.
svntest.main.run_svn(None, 'delete', os.path.join('A2', 'mu'))
- svntest.main.run_svn(expected_error, 'update', os.path.join('A2', 'mu'))
+
+ expected_output = svntest.wc.State('A2', {
+ 'mu' : Item(verb='Skipped'),
+ })
+ svntest.actions.run_and_verify_update(os.path.join('A2', 'mu'),
+ expected_output, None, None, None)
if os.path.exists('A2/mu'):
raise svntest.Failure("A2/mu improperly revived")