subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1450257 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/conflicts.c libsvn_wc/wc_db.h libsvn_wc/wc_db_update_move.c svn/notify.c tests/cmdline/svntest/actions.py
Date Tue, 26 Feb 2013 16:22:53 GMT
Author: stsp
Date: Tue Feb 26 16:22:53 2013
New Revision: 1450257

URL: http://svn.apache.org/r1450257
Log:
Make 'svn resolve' notify about moves which are broken.

Notifications currently only show the move source path,
and look like this:

  Breaking move with source path 'A/B/f'.

We'd need to extend svn_wc_notify_t to show the destination path as well.

Also, 'svn revert' does not yet provide these notifications. I'm not sure
yet whether 'svn revert' should provide them. It would be an extra chunk
of work anyway which can be done in a later commit if necessary.

* subversion/include/svn_wc.h
  (svn_wc_notify_action_t): Add svn_wc_notify_move_broken.

* subversion/libsvn_wc/conflicts.c
  (resolve_tree_conflict_on_node): Pass notification function/baton to
   svn_wc__db_resolve_break_moved_away() (and to the _children() variant).

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_resolve_break_moved_away,
   svn_wc__db_resolve_break_moved_away_children): Add notify func/baton params.

* subversion/libsvn_wc/wc_db_update_move.c
  (break_moved_away_children_internal, 
   svn_wc__db_resolve_break_moved_away,
   svn_wc__db_resolve_break_moved_away_children): Notify broken moves.

* subversion/svn/notify.c
  (notify): Handle svn_wc_notify_move_broken. Add a missing 'break' while here.

* subversion/tests/cmdline/svntest/actions.py
  (_run_and_verify_resolve): Accept the new notifcation, but don't require it.
   This avoids breaking existing tests that resolve conflicted nodes which
   have been moved.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
    subversion/trunk/subversion/svn/notify.c
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Tue Feb 26 16:22:53 2013
@@ -1249,7 +1249,13 @@ typedef enum svn_wc_notify_action_t
 
   /** A copy from a foreign repository has started 
    * @since New in 1.8. */
-  svn_wc_notify_foreign_copy_begin
+  svn_wc_notify_foreign_copy_begin,
+
+  /** A move in the working copy has been broken, i.e. degraded into a
+   * copy + delete. The notified path is the move source (the deleted path).
+   * ### Provide path to move destination as well?
+   * @since New in 1.8. */
+  svn_wc_notify_move_broken
 
 } svn_wc_notify_action_t;
 

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Tue Feb 26 16:22:53 2013
@@ -2672,7 +2672,8 @@ resolve_tree_conflict_on_node(svn_skel_t
               /* Break moves for any children moved out of this directory,
                * and leave this directory deleted. */
               SVN_ERR(svn_wc__db_resolve_break_moved_away_children(
-                        db, local_abspath, scratch_pool));
+                        db, local_abspath, notify_func, notify_baton,
+                        scratch_pool));
               did_resolve = TRUE;
             }
           else if (conflict_choice == svn_wc_conflict_choose_mine_conflict)
@@ -2722,6 +2723,8 @@ resolve_tree_conflict_on_node(svn_skel_t
                  ### involving the move until
                  ### svn_wc__db_op_mark_resolved. */
               SVN_ERR(svn_wc__db_resolve_break_moved_away(db, local_abspath,
+                                                          notify_func,
+                                                          notify_baton,
                                                           scratch_pool));
               did_resolve = TRUE;
             }

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue Feb 26 16:22:53 2013
@@ -3351,6 +3351,8 @@ svn_wc__db_resolve_delete_raise_moved_aw
 svn_error_t *
 svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
                                     const char *local_abspath,
+                                    svn_wc_notify_func2_t notify_func,
+                                    void *notify_baton,
                                     apr_pool_t *scratch_pool);
 
 /* Break moves for all moved-away children of LOCAL_ABSPATH, within
@@ -3361,6 +3363,8 @@ svn_wc__db_resolve_break_moved_away(svn_
 svn_error_t *
 svn_wc__db_resolve_break_moved_away_children(svn_wc__db_t *db,
                                              const char *local_abspath,
+                                             svn_wc_notify_func2_t notify_func,
+                                             void *notify_baton,
                                              apr_pool_t *scratch_pool);
 /* @} */
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Tue Feb 26 16:22:53 2013
@@ -2401,6 +2401,9 @@ break_moved_away_children_internal(svn_w
   svn_boolean_t have_row;
   apr_pool_t *iterpool;
 
+  SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
+                                      STMT_CREATE_UPDATE_MOVE_LIST));
+
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_MOVED_PAIR2));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -2417,6 +2420,11 @@ break_moved_away_children_internal(svn_w
 
       SVN_ERR(break_move(wcroot, src_relpath, src_op_depth, dst_relpath,
                          relpath_depth(dst_relpath), iterpool));
+      SVN_ERR(update_move_list_add(wcroot, src_relpath,
+                                   svn_wc_notify_move_broken,
+                                   svn_node_unknown,
+                                   svn_wc_notify_state_inapplicable,
+                                   svn_wc_notify_state_inapplicable));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
     }
   svn_pool_destroy(iterpool);
@@ -2429,6 +2437,8 @@ break_moved_away_children_internal(svn_w
 svn_error_t *
 svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
                                     const char *local_abspath,
+                                    svn_wc_notify_func2_t notify_func,
+                                    void *notify_baton,
                                     apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
@@ -2444,12 +2454,30 @@ svn_wc__db_resolve_break_moved_away(svn_
                                                  scratch_pool),
     wcroot);
 
+  if (notify_func)
+    {
+      svn_wc_notify_t *notify;
+
+      notify = svn_wc_create_notify(svn_dirent_join(wcroot->abspath,
+                                                    local_relpath,
+                                                    scratch_pool),
+                                    svn_wc_notify_move_broken,
+                                    scratch_pool);
+      notify->kind = svn_node_unknown;
+      notify->content_state = svn_wc_notify_state_inapplicable;
+      notify->prop_state = svn_wc_notify_state_inapplicable;
+      notify->revision = SVN_INVALID_REVNUM;
+      notify_func(notify_baton, notify, scratch_pool);
+    }
+
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
 svn_wc__db_resolve_break_moved_away_children(svn_wc__db_t *db,
                                              const char *local_abspath,
+                                             svn_wc_notify_func2_t notify_func,
+                                             void *notify_baton,
                                              apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
@@ -2464,5 +2492,10 @@ svn_wc__db_resolve_break_moved_away_chil
     break_moved_away_children_internal(wcroot, local_relpath, scratch_pool),
     wcroot);
 
+  SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,
+                                             SVN_INVALID_REVNUM,
+                                             SVN_INVALID_REVNUM,
+                                             notify_func, notify_baton,
+                                             scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Tue Feb 26 16:22:53 2013
@@ -1016,6 +1016,15 @@ notify(void *baton, const svn_wc_notify_
                                  n->url);
       if (err)
         goto print_error;
+      break;
+
+    case svn_wc_notify_move_broken:
+        err = svn_cmdline_printf(pool,
+                                 _("Breaking move with source path '%s'\n"),
+                                 path_local);
+      if (err)
+        goto print_error;
+      break;
 
     default:
       break;

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1450257&r1=1450256&r2=1450257&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Tue Feb 26 16:22:53 2013
@@ -1808,9 +1808,17 @@ def _run_and_verify_resolve(cmd, expecte
   # TODO: verify that the status of PATHS changes accordingly.
   if len(args) == 0:
     args = expected_paths
-  expected_output = verify.UnorderedOutput([
-    "Resolved conflicted state of '" + path + "'\n" for path in
-    expected_paths])
+  expected_output = verify.AlternateOutput([
+      verify.UnorderedOutput([
+        "Resolved conflicted state of '" + path + "'\n" for path in
+        expected_paths]),
+      verify.UnorderedOutput([
+        "Breaking move with source path '" + path + "'\n" for path in
+         expected_paths] + [
+        "Resolved conflicted state of '" + path + "'\n" for path in
+        expected_paths]),
+    ],
+    match_all=False)
   run_and_verify_svn(None, expected_output, [],
                      cmd, *args)
 



Mime
View raw message