You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/04/20 00:01:30 UTC

svn commit: r935756 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c lock.c update_editor.c wc.h

Author: hwright
Date: Mon Apr 19 22:01:30 2010
New Revision: 935756

URL: http://svn.apache.org/viewvc?rev=935756&view=rev
Log:
Remove a temporary API.  This also allows reverting an added directory which is
the CWD.

* subversion/libsvn_wc/wc.h
  (svn_wc__temp_get_relpath): Remove.

* subversion/libsvn_wc/adm_ops.c
  (revert_entry): Don't use the API, and in the process, allow a revert of
    an added directory if it is the CWD.
  (revert_internal): Remove an unused path, and superflous call to the
    temp API.

* subversion/libsvn_wc/update_editor.c
  (make_editor): Use the anchor_abspath in place of the relpath, and remove
    a call to the temp API.

* subversion/libsvn_wc/lock.c
  (svn_wc__temp_get_relpath): Remove.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/lock.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=935756&r1=935755&r2=935756&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Apr 19 22:01:30 2010
@@ -1866,18 +1866,6 @@ revert_entry(svn_depth_t *depth,
         }
       else if (kind == svn_wc__db_kind_dir)
         {
-          const char *path;
-          SVN_ERR(svn_wc__temp_get_relpath(&path, db, local_abspath,
-                                           pool, pool));
-
-          /* We are trying to revert the current directory which is
-             scheduled for addition. This is supposed to fail (Issue #854) */
-          if (path[0] == '\0')
-            return svn_error_create(SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
-                                    _("Cannot revert addition of current "
-                                      "directory; please try again from the "
-                                      "parent directory"));
-
           /* We don't need to check for excluded item, since we won't fall
              into this code path in that case. */
 
@@ -1996,11 +1984,8 @@ revert_internal(svn_wc__db_t *db,
   svn_wc__db_kind_t db_kind;
   svn_boolean_t unversioned;
   const svn_wc_conflict_description2_t *tree_conflict;
-  const char *path;
   svn_error_t *err;
 
-  SVN_ERR(svn_wc__temp_get_relpath(&path, db, local_abspath, pool, pool));
-
   /* Check cancellation here, so recursive calls get checked early. */
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
@@ -2029,7 +2014,8 @@ revert_internal(svn_wc__db_t *db,
                                            pool, pool));
   if (unversioned && tree_conflict == NULL)
     return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("Cannot revert unversioned item '%s'"), path);
+                             _("Cannot revert unversioned item '%s'"),
+                             local_abspath);
 
   /* Safeguard 1.5:  is this a missing versioned directory? */
   SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, pool));

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=935756&r1=935755&r2=935756&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Mon Apr 19 22:01:30 2010
@@ -1542,44 +1542,6 @@ svn_wc__adm_missing(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__temp_get_relpath(const char **rel_path,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  const char *suffix = "";
-  const char *abspath = local_abspath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  while (TRUE)
-  {
-    svn_wc_adm_access_t *adm_access =
-        svn_wc__adm_retrieve_internal2(db, abspath, scratch_pool);
-
-    if (adm_access != NULL)
-      {
-        *rel_path = svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                                    suffix, result_pool);
-        return SVN_NO_ERROR;
-      }
-
-    if (svn_dirent_is_root(abspath, strlen(abspath)))
-      {
-        /* Not found, so no problem calling it abspath */
-        *rel_path = apr_pstrdup(result_pool, local_abspath);
-        return SVN_NO_ERROR;
-      }
-
-    suffix = svn_dirent_join(suffix, svn_dirent_basename(local_abspath, NULL),
-                             scratch_pool);
-    abspath = svn_dirent_dirname(abspath, scratch_pool);
-  }
-}
-
-
-svn_error_t *
 svn_wc__acquire_write_lock(const char **anchor_abspath,
                            svn_wc_context_t *wc_ctx,
                            const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=935756&r1=935755&r2=935756&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Apr 19 22:01:30 2010
@@ -5176,10 +5176,6 @@ make_editor(svn_revnum_t *target_revisio
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(edit_pool);
   const svn_delta_editor_t *inner_editor;
   const char *repos_root, *repos_uuid;
-  const char *anchor;
-
-  SVN_ERR(svn_wc__temp_get_relpath(&anchor, wc_ctx->db, anchor_abspath,
-                                   result_pool, scratch_pool));
 
   /* An unknown depth can't be sticky. */
   if (depth == svn_depth_unknown)
@@ -5282,7 +5278,7 @@ make_editor(svn_revnum_t *target_revisio
                                                 &inner_baton,
                                                 inner_editor,
                                                 inner_baton,
-                                                anchor,
+                                                anchor_abspath,
                                                 target_basename,
                                                 wc_ctx->db,
                                                 result_pool));

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=935756&r1=935755&r2=935756&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Mon Apr 19 22:01:30 2010
@@ -653,21 +653,6 @@ svn_wc__check_wc_root(svn_boolean_t *wc_
                       const char *local_abspath,
                       apr_pool_t *scratch_pool);
 
-/* Gets the relative path REL_PATH as used by the access batons in WC_CTX,
- * by looking at open access batons of LOCAL_ABSPATH and its parents.
- * Perform temporary allocations in SCRATCH_POOL and return the result in
- * RESULT_POOL.
- *
- * Sets REL_PATH to a copy of LOCAL_ABSPATH when no access batons for this
- * node or any of its parents are found
- */
-svn_error_t *
-svn_wc__temp_get_relpath(const char **rel_path,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */



Re: svn commit: r935756 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c lock.c update_editor.c wc.h

Posted by Greg Stein <gs...@gmail.com>.
On Mon, Apr 19, 2010 at 18:01,  <hw...@apache.org> wrote:
> Author: hwright
> Date: Mon Apr 19 22:01:30 2010
> New Revision: 935756
>
> URL: http://svn.apache.org/viewvc?rev=935756&view=rev
> Log:
> Remove a temporary API.  This also allows reverting an added directory which is
> the CWD.
>
> * subversion/libsvn_wc/wc.h
>  (svn_wc__temp_get_relpath): Remove.
>
> * subversion/libsvn_wc/adm_ops.c
>  (revert_entry): Don't use the API, and in the process, allow a revert of
>    an added directory if it is the CWD.

You might want to clarify that the code (contrary to issue #854) is
now capable of performing a revert on the current directory.

>...
> +++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Apr 19 22:01:30 2010
>...
> @@ -2029,7 +2014,8 @@ revert_internal(svn_wc__db_t *db,
>                                            pool, pool));
>   if (unversioned && tree_conflict == NULL)
>     return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
> -                             _("Cannot revert unversioned item '%s'"), path);
> +                             _("Cannot revert unversioned item '%s'"),
> +                             local_abspath);

Shouldn't this use svn_dirent_local_style() ??

>...
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Apr 19 22:01:30 2010
>...
> @@ -5282,7 +5278,7 @@ make_editor(svn_revnum_t *target_revisio
>                                                 &inner_baton,
>                                                 inner_editor,
>                                                 inner_baton,
> -                                                anchor,
> +                                                anchor_abspath,
>                                                 target_basename,
>                                                 wc_ctx->db,
>                                                 result_pool));

Woah. The ambient depth filter still uses eb->anchor distinctly from
eb->anchor_abspath. You can't make the above change unless/until you
change that filter.

>...

Cheers,
-g