subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1591147 - in /subversion/branches/1.8.x: ./ subversion/libsvn_client/ subversion/libsvn_ra_serf/ subversion/svn/ subversion/tests/cmdline/ subversion/tests/libsvn_wc/ tools/server-side/mod_dontdothat/
Date Tue, 29 Apr 2014 23:45:24 GMT
Author: breser
Date: Tue Apr 29 23:45:24 2014
New Revision: 1591147

URL: http://svn.apache.org/r1591147
Log:
Merge the 1.8.x-r1536931 branch:

 * r1518942, r1536914, r1536931
   Fix commit of a specific mixed revision copy with non copy descendants that
   shadow not present nodes. This problem manifests itself as a copy of a tree
   that can't be committed because it is reported out of date.
   Justification:
     'svn cp TREE NEW-TREE; svn ci NEW-TREE' should never report out of date
     on some random descendant.
   Branch: ^/subversion/branches/1.8.x-r1536931
   Votes:
     +1: rhuijben, philip, breser


Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/CHANGES   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/configure.ac   (props changed)
    subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c
    subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c   (props changed)
    subversion/branches/1.8.x/subversion/svn/svn.c   (props changed)
    subversion/branches/1.8.x/subversion/tests/cmdline/merge_tests.py
    subversion/branches/1.8.x/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/1.8.x/tools/server-side/mod_dontdothat/mod_dontdothat.c   (props changed)

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1518942,1536914,1536931
  Merged /subversion/branches/1.8.x-r1536931:r1536934-1591145

Propchange: subversion/branches/1.8.x/CHANGES
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1536931/CHANGES:r1536934-1591145

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1591147&r1=1591146&r2=1591147&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Apr 29 23:45:24 2014
@@ -181,17 +181,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1518942, r1536914, r1536931
-   Fix commit of a specific mixed revision copy with non copy descendants that
-   shadow not present nodes. This problem manifests itself as a copy of a tree
-   that can't be committed because it is reported out of date.
-   Justification:
-     'svn cp TREE NEW-TREE; svn ci NEW-TREE' should never report out of date
-     on some random descendant.
-   Branch: ^/subversion/branches/1.8.x-r1536931
-   Votes:
-     +1: rhuijben, philip, breser
-
  * r1538812, r1538925, r1538928, r1538939
    Properly remove moved_to information when the node in its original location
    is removed.

Propchange: subversion/branches/1.8.x/configure.ac
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1536931/configure.ac:r1536934-1591145

Modified: subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c?rev=1591147&r1=1591146&r2=1591147&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/commit_util.c Tue Apr 29 23:45:24 2014
@@ -966,17 +966,19 @@ struct handle_descendants_baton
   void *cancel_baton;
   svn_client__check_url_kind_t check_url_func;
   void *check_url_baton;
+  svn_client__committables_t *committables;
 };
 
 /* Helper for the commit harvesters */
 static svn_error_t *
 handle_descendants(void *baton,
-                       const void *key, apr_ssize_t klen, void *val,
-                       apr_pool_t *pool)
+                   const void *key, apr_ssize_t klen, void *val,
+                   apr_pool_t *pool)
 {
   struct handle_descendants_baton *hdb = baton;
   apr_array_header_t *commit_items = val;
   apr_pool_t *iterpool = svn_pool_create(pool);
+  const char *repos_root_url = key;
   int i;
 
   for (i = 0; i < commit_items->nelts; i++)
@@ -1002,32 +1004,64 @@ handle_descendants(void *baton,
 
       for (j = 0; j < absent_descendants->nelts; j++)
         {
-          int k;
-          svn_boolean_t found_item = FALSE;
           svn_node_kind_t kind;
+          svn_client_commit_item3_t *desc_item;
           const char *relpath = APR_ARRAY_IDX(absent_descendants, j,
                                               const char *);
           const char *local_abspath = svn_dirent_join(item->path, relpath,
                                                       iterpool);
 
-          /* If the path has a commit operation, we do nothing.
-             (It will be deleted by the operation) */
-          for (k = 0; k < commit_items->nelts; k++)
+          /* ### Need a sub-iterpool? */
+
+
+          /* We found a 'not present' descendant during a copy (at op_depth>0),
+             this is most commonly caused by copying some mixed revision tree.
+
+             In this case not present can imply that the node does not exist
+             in the parent revision, or that the node does. But we want to copy
+             the working copy state in which it does not exist, but might be
+             replaced. */
+
+          desc_item = svn_hash_gets(hdb->committables->by_path, local_abspath);
+
+          /* If the path has a commit operation (possibly at an higher
+             op_depth, we might want to turn an add in a replace. */
+          if (desc_item)
             {
-              svn_client_commit_item3_t *cmt_item =
-                 APR_ARRAY_IDX(commit_items, k, svn_client_commit_item3_t *);
+              const char *dir;
+              svn_boolean_t found_intermediate = FALSE;
+
+              if (desc_item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+                continue; /* We already have a delete or replace */
+              else if (!(desc_item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD))
+                continue; /* Not a copy/add, just a modification */
 
-              if (! strcmp(cmt_item->path, local_abspath))
+              dir = svn_dirent_dirname(local_abspath, iterpool);
+
+              while (strcmp(dir, item->path))
                 {
-                  found_item = TRUE;
-                  break;
+                  svn_client_commit_item3_t *i_item;
+
+                  i_item = svn_hash_gets(hdb->committables->by_path, dir);
+
+                  if (i_item)
+                    {
+                      if ((i_item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+                          || (i_item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD))
+                        {
+                          found_intermediate = TRUE;
+                          break;
+                        }
+                    }
+                  dir = svn_dirent_dirname(dir, iterpool);
                 }
-            }
 
-          if (found_item)
-            continue; /* We have an explicit delete or replace for this path */
+              if (found_intermediate)
+                continue; /* Some intermediate ancestor is an add or delete */
 
-          /* ### Need a sub-iterpool? */
+              /* Fall through to detect if we need to turn the add in a
+                 replace. */
+            }
 
           if (hdb->check_url_func)
             {
@@ -1045,25 +1079,35 @@ handle_descendants(void *baton,
           else
             kind = svn_node_unknown; /* 'Ok' for a delete of something */
 
-          {
-            /* Add a new commit item that describes the delete */
-            apr_pool_t *result_pool = commit_items->pool;
-            svn_client_commit_item3_t *new_item
-                  = svn_client_commit_item3_create(result_pool);
-
-            new_item->path = svn_dirent_join(item->path, relpath,
-                                             result_pool);
-            new_item->kind = kind;
-            new_item->url = svn_path_url_add_component2(item->url, relpath,
-                                                        result_pool);
-            new_item->revision = SVN_INVALID_REVNUM;
-            new_item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE;
-            new_item->incoming_prop_changes = apr_array_make(result_pool, 1,
-                                                 sizeof(svn_prop_t *));
-
-            APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *)
-                  = new_item;
-          }
+          if (desc_item)
+            {
+              /* Extend the existing add/copy item to create a replace */
+              desc_item->state_flags |= SVN_CLIENT_COMMIT_ITEM_DELETE;
+              continue;
+            }
+
+          /* Add a new commit item that describes the delete */
+
+          SVN_ERR(add_committable(hdb->committables,
+                                  svn_dirent_join(item->path, relpath,
+                                                  iterpool),
+                                  kind,
+                                  repos_root_url,
+                                  svn_uri_skip_ancestor(
+                                        repos_root_url,
+                                        svn_path_url_add_component2(item->url,
+                                                                    relpath,
+                                                                    iterpool),
+                                        iterpool),
+                                  SVN_INVALID_REVNUM,
+                                  NULL /* copyfrom_relpath */,
+                                  SVN_INVALID_REVNUM,
+                                  NULL /* moved_from_abspath */,
+                                  SVN_CLIENT_COMMIT_ITEM_DELETE,
+                                  NULL /* lock tokens */,
+                                  NULL /* lock */,
+                                  commit_items->pool,
+                                  iterpool));
         }
       }
 
@@ -1181,6 +1225,7 @@ svn_client__harvest_committables(svn_cli
   hdb.cancel_baton = ctx->cancel_baton;
   hdb.check_url_func = check_url_func;
   hdb.check_url_baton = check_url_baton;
+  hdb.committables = *committables;
 
   SVN_ERR(svn_iter_apr_hash(NULL, (*committables)->by_repository,
                             handle_descendants, &hdb, iterpool));
@@ -1274,6 +1319,7 @@ harvest_copy_committables(void *baton, v
   hdb.cancel_baton = btn->ctx->cancel_baton;
   hdb.check_url_func = btn->check_url_func;
   hdb.check_url_baton = btn->check_url_baton;
+  hdb.committables = btn->committables;
 
   SVN_ERR(svn_iter_apr_hash(NULL, btn->committables->by_repository,
                             handle_descendants, &hdb, pool));

Propchange: subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c:r1536934-1591145
  Merged /subversion/trunk/subversion/libsvn_ra_serf/locks.c:r1518942,1536914,1536931

Propchange: subversion/branches/1.8.x/subversion/svn/svn.c
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1536931/subversion/svn/svn.c:r1536934-1591145

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/merge_tests.py?rev=1591147&r1=1591146&r2=1591147&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/merge_tests.py Tue Apr 29 23:45:24
2014
@@ -2047,7 +2047,7 @@ def merge_binary_with_common_ancestry(sb
   # Commit the second branch
   expected_output = wc.State(wc_dir, {
     'L'       : Item(verb='Adding'),
-    'L/theta' : Item(verb='Adding  (bin)'),
+    'L/theta' : Item(verb='Replacing'),
     })
 
   expected_status.add({

Modified: subversion/branches/1.8.x/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/libsvn_wc/op-depth-test.c?rev=1591147&r1=1591146&r2=1591147&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/1.8.x/subversion/tests/libsvn_wc/op-depth-test.c Tue Apr 29 23:45:24
2014
@@ -8493,6 +8493,61 @@ move_revert_intermediate(const svn_test_
 }
 
 static svn_error_t *
+copy_mixed_rev_mods(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "copy_mixed_rev_mods", opts,
+                                   pool));
+
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+  SVN_ERR(sbox_wc_update(&b, "A/B", 2));
+  SVN_ERR(sbox_wc_delete(&b, "A/B"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",      "normal",       1, ""},
+      {0, "A",     "normal",       1, "A"},
+      {0, "A/B",   "normal",       2, "A/B"},
+      {0, "A/B/C", "normal",       2, "A/B/C"},
+      {2, "A/B",   "normal",       NO_COPY_FROM},
+      {2, "A/B/C", "base-deleted", NO_COPY_FROM},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_copy(&b, "A", "X"));
+  {
+    nodes_row_t nodes[] = {
+      {1, "X",   "normal",      1, "A"},
+      {1, "X/B", "not-present", 2, "A/B"},
+      {2, "X/B", "normal",      NO_COPY_FROM},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "X", nodes));
+  }
+
+  SVN_ERR(sbox_wc_commit(&b, "X"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "X",   "normal", 3, "X"},
+      {0, "X/B", "normal", 3, "X/B"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "X", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 move_replace_ancestor_with_child(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
     svn_test__sandbox_t b;
@@ -8885,5 +8940,7 @@ struct svn_test_descriptor_t test_funcs[
                        "move twice and then delete"),
     SVN_TEST_OPTS_PASS(repo_wc_copy,
                        "repo_wc_copy"),
+    SVN_TEST_OPTS_PASS(copy_mixed_rev_mods,
+                       "copy mixed-rev with mods"),
     SVN_TEST_NULL
   };

Propchange: subversion/branches/1.8.x/tools/server-side/mod_dontdothat/mod_dontdothat.c
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1554978/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1555500-1565076
  Merged /subversion/branches/1.8.x-issue4480/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1588773-1591136
  Merged /subversion/branches/1.8.x-r1577812/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1577814-1588145
  Merged /subversion/branches/1.8.x-r1564215/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1564281-1564620
  Merged /subversion/branches/1.8.x-r1567985/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1568016-1568055
  Merged /subversion/trunk/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1467951,1468109,1468116,1469833,1470221,1470650,1478617,1480426,1480681,1481418,1481782,1493102,1496127,1497614,1498000,1499470,1512067,1512119,1518942,1519816,1519823,1531014,1532316,1534149,1535115,1535532,1535610,1535676,1536350,1536383,1536464,1536488,1536914,1536931,1537018,1540752,1541635,1541638,1541705,1541790,1542042,1542071,1542119,1542129,1542138,1542146,1542151,1542765,1542767,1542774,1543145,1543187,1543413,1543961,1544295,1544316,1544878,1544895,1545302,1545835,1545845,1547252,1547774,1547866,1547873,1548097,1548105,1548170,1548486,1548673,1549858,1549874,1550803,1551524,1551579,1553101,1553105,1553113,1553376-1553377,1554978,1555403,1555499,1557320,1557522,1559009,1560690,1560701,1563110,1564292,1564966,1564969,1565085,1567064,1567109,1567134,1567204,1567228,1567286,1567392,1567492,1567494,1567740,1567752,1567985,1568070,1568872,1568953,1568955,1570642,1571214,1571747,1571787,1571795,1572102,
 1572200,1573088,1573106,1573209,1574868,1575270,1575284,1575525,1575915,1577151,1577200,1577294,1577739,1577755,1577812-1577813,1578273,1578311,1578326,1578670,1578820,1578853,1578875,1579274,1579429,1579588,1579684,1580626,1580650,1580832,1580867,1580872,1581296,1581305,1581315,1581430,1581810,1583580,1583977,1584342,1584576,1584592,1584745,1585686,1586052,1586255,1586352,1586467,1587511,1587946,1587968,1588772,1588778
  Merged /subversion/branches/1.8.x-issue4437/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1567249-1591140
  Merged /subversion/branches/1.8.x-r1584342/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1584350-1589572
  Merged /subversion/branches/1.8.x-javahl-exception-crash/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1586424-1588151
  Merged /subversion/branches/1.8.x-r1579588/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1579589-1591112
  Merged /subversion/branches/1.8.x-r1578311/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1578312-1589576
  Merged /subversion/branches/1.8.x-apr-0.9/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1585493-1589570
  Merged /subversion/branches/1.8.x-r1567286/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1567364-1567731
  Merged /subversion/branches/1.8.x-r1577151/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1589064-1589574
  Merged /subversion/branches/1.8.x-r1536931/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1536934-1591145
  Merged /subversion/branches/1.8.x-r1578853/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1578879-1581682
  Merged /subversion/branches/1.8.x-r1580626/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1580631,1580652,1580661,1581435,1588382-1591134
  Merged /subversion/branches/1.8.x-r1574868/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1575329-1579873
  Merged /subversion/branches/1.8.x-r1581305/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1581320-1582587
  Merged /subversion/branches/1.8.x-r1541790/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1541791-1542075
  Merged /subversion/branches/1.8.x-serf-no-lock-support/tools/server-side/mod_dontdothat/mod_dontdothat.c:r1584583-1591109



Mime
View raw message