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 2010/03/07 14:37:09 UTC

svn commit: r919992 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Author: rhuijben
Date: Sun Mar  7 13:37:09 2010
New Revision: 919992

URL: http://svn.apache.org/viewvc?rev=919992&view=rev
Log:
Replace the loggy_tweak_entry() function in the update editor by two more
specific functions. One for updating BASE_NODE from the update editor and
one for updating WORKING_NODE from svn_wc_add_repos_file4().

* subversion/libsvn_wc/update_editor.c
  (loggy_tweak_entry): Rename to ...
  (loggy_tweak_base_node): ... this. Remove dir_abspath argument and
    get parent directory internally.
  (merge_file): Update to use loggy_tweak_base_node.

  (loggy_tweak_working_node): New function, based on the old
    loggy_tweak_entry() function. Remove updating of deleted, absent,
    url and revnum, which only apply to updating base nodes.
  (svn_wc_add_repos_file4): Update to use loggy_tweak_working_node.

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=919992&r1=919991&r2=919992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun Mar  7 13:37:09 2010
@@ -4583,19 +4583,16 @@
   return SVN_NO_ERROR;
 }
 
-/* TODO ### Update to mention LOCAL_ABSPATH, DIR_ABSPATH; not NAME, ADM_ACCESS.
-
-   Append, to LOG_ACCUM, log commands to update the entry for NAME in
-   ADM_ACCESS with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
+/* Append to LOG_ACCUM, log commands to update the entry for LOCAL_ABSPATH
+   with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
    the entry refers to a file and has no absent or deleted state.
    Use POOL for temporary allocations. */
 static svn_error_t *
-loggy_tweak_entry(svn_stringbuf_t *log_accum,
-                  const char *local_abspath,
-                  const char *dir_abspath,
-                  svn_revnum_t new_revision,
-                  const char *new_URL,
-                  apr_pool_t *pool)
+loggy_tweak_base_node(svn_stringbuf_t *log_accum,
+                      const char *local_abspath,
+                      svn_revnum_t new_revision,
+                      const char *new_URL,
+                      apr_pool_t *pool)
 {
   /* Write log entry which will bump the revision number.  Also, just
      in case we're overwriting an existing phantom 'deleted' or
@@ -4631,7 +4628,8 @@
     }
 
   return svn_error_return(
-    svn_wc__loggy_entry_modify(&log_accum, dir_abspath,
+    svn_wc__loggy_entry_modify(&log_accum,
+                               svn_dirent_dirname(local_abspath, pool),
                                local_abspath, &tmp_entry, modify_flags,
                                pool, pool));
 }
@@ -4758,8 +4756,8 @@
   /* Set the new revision and URL in the entry and clean up some other
      fields. This clears DELETED from any prior versioned file with the
      same name (needed before attempting to install props).  */
-  SVN_ERR(loggy_tweak_entry(log_accum, fb->local_abspath, pb->local_abspath,
-                            *eb->target_revision, fb->new_URL, pool));
+  SVN_ERR(loggy_tweak_base_node(log_accum, fb->local_abspath,
+                                *eb->target_revision, fb->new_URL, pool));
 
   /* Install all kinds of properties.  It is important to do this before
      any file content merging, since that process might expand keywords, in
@@ -5980,6 +5978,41 @@
                                         pool));
 }
 
+/* Append, to LOG_ACCUM, log commands to update the entry for LOCAL_ABSPATH
+   with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
+   the entry refers to a file and has no absent or deleted state.
+   Use POOL for temporary allocations. */
+static svn_error_t *
+loggy_tweak_working_node(svn_stringbuf_t *log_accum,
+                         const char *local_abspath,
+                         apr_pool_t *pool)
+{
+  /* Write log entry which will bump the revision number.  Also, just
+     in case we're overwriting an existing phantom 'deleted' or
+     'absent' entry, be sure to remove the hiddenness. */
+  svn_wc_entry_t tmp_entry;
+  apr_uint64_t modify_flags = SVN_WC__ENTRY_MODIFY_KIND
+    | SVN_WC__ENTRY_MODIFY_TEXT_TIME
+    | SVN_WC__ENTRY_MODIFY_WORKING_SIZE;
+
+  tmp_entry.kind = svn_node_file;
+  /* Indicate the file was locally modified and we didn't get to
+     calculate the true value, but we can't set it to UNKNOWN (-1),
+     because that would indicate absense of this value.
+     If it isn't locally modified,
+     we'll overwrite with the actual value later. */
+  tmp_entry.working_size = SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN;
+  /* The same is true for the TEXT_TIME field, except that that doesn't
+     have an explicid 'changed' value, so we set the value to 'undefined'. */
+  tmp_entry.text_time = 0;
+
+  return svn_error_return(
+    svn_wc__loggy_entry_modify(&log_accum,
+                               svn_dirent_dirname(local_abspath, pool),
+                               local_abspath,  &tmp_entry, modify_flags,
+                               pool, pool));
+}
+
 /* ### Note that this function is completely different from the rest of the
        update editor in what it updates. The update editor changes only BASE
        and ACTUAL and this function just changes WORKING and ACTUAL.
@@ -6096,12 +6129,8 @@
                                        modify_flags, pool, pool));
   }
 
-  /* Set the new revision number and URL in the entry and clean up some other
-     fields. This clears DELETED from any prior versioned file with the
-     same name (needed before attempting to install props).  */
-  SVN_ERR(loggy_tweak_entry(pre_props_accum, local_abspath, dir_abspath,
-                            dst_entry ? dst_entry->revision : ent->revision,
-                            new_URL, pool));
+  /* ### Clear working node status in preparation for writing a new node. */
+  SVN_ERR(loggy_tweak_working_node(pre_props_accum, local_abspath, pool));
 
   post_props_accum = svn_stringbuf_create("", pool);
 



Re: svn commit: r919992 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by Julian Foad <ju...@wandisco.com>.
On Sun, 2010-03-07, rhuijben@apache.org wrote:
> Author: rhuijben
> Date: Sun Mar  7 13:37:09 2010
> New Revision: 919992
> 
> URL: http://svn.apache.org/viewvc?rev=919992&view=rev
> Log:
> Replace the loggy_tweak_entry() function in the update editor by two more
> specific functions. One for updating BASE_NODE from the update editor and
> one for updating WORKING_NODE from svn_wc_add_repos_file4().
> 
> * subversion/libsvn_wc/update_editor.c
>   (loggy_tweak_entry): Rename to ...
>   (loggy_tweak_base_node): ... this. Remove dir_abspath argument and
>     get parent directory internally.
>   (merge_file): Update to use loggy_tweak_base_node.
> 
>   (loggy_tweak_working_node): New function, based on the old
>     loggy_tweak_entry() function. Remove updating of deleted, absent,
>     url and revnum, which only apply to updating base nodes.
>   (svn_wc_add_repos_file4): Update to use loggy_tweak_working_node.

[...]
> +/* Append, to LOG_ACCUM, log commands to update the entry for LOCAL_ABSPATH
> +   with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
> +   the entry refers to a file and has no absent or deleted state.
> +   Use POOL for temporary allocations. */
> +static svn_error_t *
> +loggy_tweak_working_node(svn_stringbuf_t *log_accum,
> +                         const char *local_abspath,
> +                         apr_pool_t *pool)

Oops - the doc string was for the previous incarnation of this function.

- Julian


> +{
> +  /* Write log entry which will bump the revision number.  Also, just
> +     in case we're overwriting an existing phantom 'deleted' or
> +     'absent' entry, be sure to remove the hiddenness. */
> +  svn_wc_entry_t tmp_entry;
> +  apr_uint64_t modify_flags = SVN_WC__ENTRY_MODIFY_KIND
> +    | SVN_WC__ENTRY_MODIFY_TEXT_TIME
> +    | SVN_WC__ENTRY_MODIFY_WORKING_SIZE;
> +
> +  tmp_entry.kind = svn_node_file;
> +  /* Indicate the file was locally modified and we didn't get to
> +     calculate the true value, but we can't set it to UNKNOWN (-1),
> +     because that would indicate absense of this value.
> +     If it isn't locally modified,
> +     we'll overwrite with the actual value later. */
> +  tmp_entry.working_size = SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN;
> +  /* The same is true for the TEXT_TIME field, except that that doesn't
> +     have an explicid 'changed' value, so we set the value to 'undefined'. */
> +  tmp_entry.text_time = 0;
> +
> +  return svn_error_return(
> +    svn_wc__loggy_entry_modify(&log_accum,
> +                               svn_dirent_dirname(local_abspath, pool),
> +                               local_abspath,  &tmp_entry, modify_flags,
> +                               pool, pool));
> +}

[...] 
> -  /* Set the new revision number and URL in the entry and clean up some other
> -     fields. This clears DELETED from any prior versioned file with the
> -     same name (needed before attempting to install props).  */
> -  SVN_ERR(loggy_tweak_entry(pre_props_accum, local_abspath, dir_abspath,
> -                            dst_entry ? dst_entry->revision : ent->revision,
> -                            new_URL, pool));
> +  /* ### Clear working node status in preparation for writing a new node. */
> +  SVN_ERR(loggy_tweak_working_node(pre_props_accum, local_abspath, pool));


Re: svn commit: r919992 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by Julian Foad <ju...@wandisco.com>.
On Sun, 2010-03-07, rhuijben@apache.org wrote:
> Author: rhuijben
> Date: Sun Mar  7 13:37:09 2010
> New Revision: 919992
> 
> URL: http://svn.apache.org/viewvc?rev=919992&view=rev
> Log:
> Replace the loggy_tweak_entry() function in the update editor by two more
> specific functions. One for updating BASE_NODE from the update editor and
> one for updating WORKING_NODE from svn_wc_add_repos_file4().
> 
> * subversion/libsvn_wc/update_editor.c
>   (loggy_tweak_entry): Rename to ...
>   (loggy_tweak_base_node): ... this. Remove dir_abspath argument and
>     get parent directory internally.
>   (merge_file): Update to use loggy_tweak_base_node.
> 
>   (loggy_tweak_working_node): New function, based on the old
>     loggy_tweak_entry() function. Remove updating of deleted, absent,
>     url and revnum, which only apply to updating base nodes.
>   (svn_wc_add_repos_file4): Update to use loggy_tweak_working_node.

[...]
> +/* Append, to LOG_ACCUM, log commands to update the entry for LOCAL_ABSPATH
> +   with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
> +   the entry refers to a file and has no absent or deleted state.
> +   Use POOL for temporary allocations. */
> +static svn_error_t *
> +loggy_tweak_working_node(svn_stringbuf_t *log_accum,
> +                         const char *local_abspath,
> +                         apr_pool_t *pool)

Oops - the doc string was for the previous incarnation of this function.

- Julian


> +{
> +  /* Write log entry which will bump the revision number.  Also, just
> +     in case we're overwriting an existing phantom 'deleted' or
> +     'absent' entry, be sure to remove the hiddenness. */
> +  svn_wc_entry_t tmp_entry;
> +  apr_uint64_t modify_flags = SVN_WC__ENTRY_MODIFY_KIND
> +    | SVN_WC__ENTRY_MODIFY_TEXT_TIME
> +    | SVN_WC__ENTRY_MODIFY_WORKING_SIZE;
> +
> +  tmp_entry.kind = svn_node_file;
> +  /* Indicate the file was locally modified and we didn't get to
> +     calculate the true value, but we can't set it to UNKNOWN (-1),
> +     because that would indicate absense of this value.
> +     If it isn't locally modified,
> +     we'll overwrite with the actual value later. */
> +  tmp_entry.working_size = SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN;
> +  /* The same is true for the TEXT_TIME field, except that that doesn't
> +     have an explicid 'changed' value, so we set the value to 'undefined'. */
> +  tmp_entry.text_time = 0;
> +
> +  return svn_error_return(
> +    svn_wc__loggy_entry_modify(&log_accum,
> +                               svn_dirent_dirname(local_abspath, pool),
> +                               local_abspath,  &tmp_entry, modify_flags,
> +                               pool, pool));
> +}

[...] 
> -  /* Set the new revision number and URL in the entry and clean up some other
> -     fields. This clears DELETED from any prior versioned file with the
> -     same name (needed before attempting to install props).  */
> -  SVN_ERR(loggy_tweak_entry(pre_props_accum, local_abspath, dir_abspath,
> -                            dst_entry ? dst_entry->revision : ent->revision,
> -                            new_URL, pool));
> +  /* ### Clear working node status in preparation for writing a new node. */
> +  SVN_ERR(loggy_tweak_working_node(pre_props_accum, local_abspath, pool));