You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/07/02 12:40:22 UTC

svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Author: stsp
Date: Tue Jul  2 10:40:22 2013
New Revision: 1498873

URL: http://svn.apache.org/r1498873
Log:
Make svn_wc__serialize_conflict() and svn_wc__deserialize_conflict() use the
new conflict description structure (svn_wc_conflict_description3_t).

* subversion/libsvn_wc/entries.c
  (read_one_entry): Remove now unneeded conversion to old conflict description.
  (write_entry): Pass new conflict description svn_wc__deserialize_conflict().

* subversion/libsvn_wc/tree_conflicts.c
  (svn_wc__deserialize_conflict, svn_wc__serialize_conflict): Use new conflict
   description. As far as tree conflicts are concerned, both descriptions are
   still equivalent so this is not a functional change yet.

* subversion/libsvn_wc/tree_conflicts.h
  (svn_wc__deserialize_conflict, svn_wc__serialize_conflict): Update docstrings
   and declarations.

* subversion/libsvn_wc/upgrade.c
  (read_tree_conflicts, migrate_single_tree_conflict_data,
   svn_wc__upgrade_conflict_skel_from_raw): Update callers.

* subversion/tests/libsvn_wc/conflict-data-test.c
  (tree_conflict_data, test_deserialize_tree_conflict,
   test_serialize_tree_conflict_data): Update callers.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/libsvn_wc/tree_conflicts.c
    subversion/trunk/subversion/libsvn_wc/tree_conflicts.h
    subversion/trunk/subversion/libsvn_wc/upgrade.c
    subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1498873&r1=1498872&r2=1498873&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Jul  2 10:40:22 2013
@@ -472,8 +472,7 @@ read_one_entry(const svn_wc_entry_t **ne
                 {
                   if (!tree_conflicts)
                     tree_conflicts = apr_hash_make(scratch_pool);
-                  svn_hash_sets(tree_conflicts, child_name,
-                                svn_wc__cd3_to_cd2(conflict, scratch_pool));
+                  svn_hash_sets(tree_conflicts, child_name, conflict);
                 }
             }
         }
@@ -1893,15 +1892,15 @@ write_entry(struct write_baton **entry_n
                              scratch_pool);
       tree_conflicts = apr_hash_make(result_pool);
       skel = skel->children;
-      while(skel)
+      while (skel)
         {
-          svn_wc_conflict_description2_t *conflict;
+          svn_wc_conflict_description3_t *conflict;
           svn_skel_t *new_skel;
           const char *key;
 
           /* *CONFLICT is allocated so it is safe to use a non-const pointer */
           SVN_ERR(svn_wc__deserialize_conflict(
-                             (const svn_wc_conflict_description2_t**)&conflict,
+                             (const svn_wc_conflict_description3_t**)&conflict,
                                                skel,
                                                svn_dirent_join(root_abspath,
                                                                local_relpath,

Modified: subversion/trunk/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/tree_conflicts.c?rev=1498873&r1=1498872&r2=1498873&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/tree_conflicts.c Tue Jul  2 10:40:22 2013
@@ -196,7 +196,7 @@ read_node_version_info(const svn_wc_conf
 
 
 svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
                              const svn_skel_t *skel,
                              const char *dir_path,
                              apr_pool_t *result_pool,
@@ -211,7 +211,7 @@ svn_wc__deserialize_conflict(const svn_w
   const svn_wc_conflict_version_t *src_left_version;
   const svn_wc_conflict_version_t *src_right_version;
   int n;
-  svn_wc_conflict_description2_t *new_conflict;
+  svn_wc_conflict_description3_t *new_conflict;
 
   if (!is_valid_conflict_skel(skel))
     return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
@@ -266,7 +266,7 @@ svn_wc__deserialize_conflict(const svn_w
   SVN_ERR(read_node_version_info(&src_right_version, skel->next,
                                  result_pool, scratch_pool));
 
-  new_conflict = svn_wc_conflict_description_create_tree2(victim_abspath,
+  new_conflict = svn_wc_conflict_description_create_tree3(victim_abspath,
     node_kind, operation, src_left_version, src_right_version,
     result_pool);
   new_conflict->action = action;
@@ -329,7 +329,7 @@ prepend_version_info_skel(svn_skel_t *pa
 
 svn_error_t *
 svn_wc__serialize_conflict(svn_skel_t **skel,
-                           const svn_wc_conflict_description2_t *conflict,
+                           const svn_wc_conflict_description3_t *conflict,
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool)
 {

Modified: subversion/trunk/subversion/libsvn_wc/tree_conflicts.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/tree_conflicts.h?rev=1498873&r1=1498872&r2=1498873&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/tree_conflicts.h (original)
+++ subversion/trunk/subversion/libsvn_wc/tree_conflicts.h Tue Jul  2 10:40:22 2013
@@ -62,18 +62,18 @@ extern "C" {
 
 svn_error_t *
 svn_wc__serialize_conflict(svn_skel_t **skel,
-                           const svn_wc_conflict_description2_t *conflict,
+                           const svn_wc_conflict_description3_t *conflict,
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
 
-/* Parse a newly allocated svn_wc_conflict_description2_t object from the
+/* Parse a newly allocated svn_wc_conflict_description3_t object from the
  * provided SKEL. Return the result in *CONFLICT, allocated in RESULT_POOL.
  * DIR_PATH is the path to the WC directory whose conflicts are being read.
  * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
                              const svn_skel_t *skel,
                              const char *dir_path,
                              apr_pool_t *result_pool,

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1498873&r1=1498872&r2=1498873&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Tue Jul  2 10:40:22 2013
@@ -654,8 +654,8 @@ ensure_repos_info(svn_wc_entry_t *entry,
 
 /*
  * Read tree conflict descriptions from @a conflict_data.  Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
+ * to a hash of pointers to svn_wc_conflict_description3_t objects indexed by
+ * svn_wc_conflict_description3_t.local_abspath, all newly allocated in @a
  * pool.  @a dir_path is the path to the working copy directory whose conflicts
  * are being read.  The conflicts read are the tree conflicts on the immediate
  * child nodes of @a dir_path.  Do all allocations in @a pool.
@@ -692,7 +692,7 @@ read_tree_conflicts(apr_hash_t **conflic
   iterpool = svn_pool_create(pool);
   for (skel = skel->children; skel != NULL; skel = skel->next)
     {
-      const svn_wc_conflict_description2_t *conflict;
+      const svn_wc_conflict_description3_t *conflict;
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
@@ -727,7 +727,7 @@ migrate_single_tree_conflict_data(svn_sq
        hi;
        hi = apr_hash_next(hi))
     {
-      const svn_wc_conflict_description2_t *conflict =
+      const svn_wc_conflict_description3_t *conflict =
           svn__apr_hash_index_val(hi);
       const char *conflict_relpath;
       const char *conflict_data;
@@ -1431,7 +1431,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
   if (tree_conflict_data)
     {
       svn_skel_t *tc_skel;
-      const svn_wc_conflict_description2_t *tc;
+      const svn_wc_conflict_description3_t *tc;
       const char *local_abspath;
 
       if (!conflict_data)

Modified: subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1498873&r1=1498872&r2=1498873&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c Tue Jul  2 10:40:22 2013
@@ -216,7 +216,7 @@ tree_conflict_create(const char *local_a
 static svn_error_t *
 test_deserialize_tree_conflict(apr_pool_t *pool)
 {
-  const svn_wc_conflict_description2_t *conflict;
+  const svn_wc_conflict_description3_t *conflict;
   svn_wc_conflict_description2_t *exp_conflict;
   const char *tree_conflict_data;
   const char *local_abspath;
@@ -248,7 +248,7 @@ test_deserialize_tree_conflict(apr_pool_
 static svn_error_t *
 test_serialize_tree_conflict_data(apr_pool_t *pool)
 {
-  svn_wc_conflict_description2_t *conflict;
+  svn_wc_conflict_description3_t *conflict;
   const char *tree_conflict_data;
   const char *expected;
   const char *local_abspath;
@@ -256,7 +256,7 @@ test_serialize_tree_conflict_data(apr_po
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Foo.c", pool));
 
-  conflict = svn_wc_conflict_description_create_tree2(
+  conflict = svn_wc_conflict_description_create_tree3(
                     local_abspath, svn_node_file, svn_wc_operation_update,
                     NULL, NULL, pool);
   conflict->action = svn_wc_conflict_action_delete;



Re: svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, Jul 2, 2013 at 2:23 PM, Stefan Sperling <st...@elego.de> wrote:
> On Tue, Jul 02, 2013 at 02:09:32PM -0400, Greg Stein wrote:
>...
>> Maybe move v3 of this structure to private? Move to an API rather than
>> bare struct?
>
> I've been considering making it private. The reason I haven't yet done
> so is that I'm not sure where we'll go next with affected APIs.
>
> The most important public API affected by this is the conflict
> resolution callback. It needs this struct or needs to be changed when
> making the struct private, e.g. to expect some set of function parameters.

Well, I naturally just think of an opaque type with various accessors.
The accessors could have smaller structures that likely won't be
revised (such as svn_wc_conflict_version_t, or one returning
kind/action/reason). Or the accessors have multiple parameters (like
fetching all the associated paths).

The bare structures (entry_t, info_t, status_t, and
conflict_description_t) are the things that have historically given us
the most pain over the years.

Cheers,
-g

Re: svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Jul 02, 2013 at 02:09:32PM -0400, Greg Stein wrote:
> On Tue, Jul 2, 2013 at 9:50 AM, Bert Huijben <be...@qqmail.nl> wrote:
> >> -----Original Message-----
> >> From: stsp@apache.org [mailto:stsp@apache.org]
> >> Sent: dinsdag 2 juli 2013 12:40
> >> To: commits@subversion.apache.org
> >> Subject: svn commit: r1498873 - in /subversion/trunk/subversion:
> >> libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h
> >> libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c
> >>
> >> Author: stsp
> >> Date: Tue Jul  2 10:40:22 2013
> >> New Revision: 1498873
> >>
> >> URL: http://svn.apache.org/r1498873
> >> Log:
> >> Make svn_wc__serialize_conflict() and svn_wc__deserialize_conflict() use
> >> the
> >> new conflict description structure (svn_wc_conflict_description3_t).
> >
> > I'm not sure if this is really what we want here. If we move this forward with the new infrastructure we have to rev it every kind when we upgrade, while it is really only used for providing svn_wc_entry_t to 1.6 style API uers, and for the upgrade from 1.6.
> 
> Maybe move v3 of this structure to private? Move to an API rather than
> bare struct?

I've been considering making it private. The reason I haven't yet done
so is that I'm not sure where we'll go next with affected APIs.

The most important public API affected by this is the conflict
resolution callback. It needs this struct or needs to be changed when
making the struct private, e.g. to expect some set of function parameters.

Perhaps now is a good time to start discussing what we should do?

Re: svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, Jul 2, 2013 at 9:50 AM, Bert Huijben <be...@qqmail.nl> wrote:
>> -----Original Message-----
>> From: stsp@apache.org [mailto:stsp@apache.org]
>> Sent: dinsdag 2 juli 2013 12:40
>> To: commits@subversion.apache.org
>> Subject: svn commit: r1498873 - in /subversion/trunk/subversion:
>> libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h
>> libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c
>>
>> Author: stsp
>> Date: Tue Jul  2 10:40:22 2013
>> New Revision: 1498873
>>
>> URL: http://svn.apache.org/r1498873
>> Log:
>> Make svn_wc__serialize_conflict() and svn_wc__deserialize_conflict() use
>> the
>> new conflict description structure (svn_wc_conflict_description3_t).
>
> I'm not sure if this is really what we want here. If we move this forward with the new infrastructure we have to rev it every kind when we upgrade, while it is really only used for providing svn_wc_entry_t to 1.6 style API uers, and for the upgrade from 1.6.

Maybe move v3 of this structure to private? Move to an API rather than
bare struct?

>...

Cheers,
-g

RE: svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stsp@apache.org [mailto:stsp@apache.org]
> Sent: dinsdag 2 juli 2013 12:40
> To: commits@subversion.apache.org
> Subject: svn commit: r1498873 - in /subversion/trunk/subversion:
> libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h
> libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c
> 
> Author: stsp
> Date: Tue Jul  2 10:40:22 2013
> New Revision: 1498873
> 
> URL: http://svn.apache.org/r1498873
> Log:
> Make svn_wc__serialize_conflict() and svn_wc__deserialize_conflict() use
> the
> new conflict description structure (svn_wc_conflict_description3_t).

I'm not sure if this is really what we want here. If we move this forward with the new infrastructure we have to rev it every kind when we upgrade, while it is really only used for providing svn_wc_entry_t to 1.6 style API uers, and for the upgrade from 1.6.

The serialization format here is locked to what we used then, and I don't know if our future in-memory-conflict data will be anything like a struct that can both be read and written.

If we have to keep the compatibility api anyway, we can just use it here and avoid revving all this in future versions.

	Bert


RE: svn commit: r1498873 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stsp@apache.org [mailto:stsp@apache.org]
> Sent: dinsdag 2 juli 2013 12:40
> To: commits@subversion.apache.org
> Subject: svn commit: r1498873 - in /subversion/trunk/subversion:
> libsvn_wc/entries.c libsvn_wc/tree_conflicts.c libsvn_wc/tree_conflicts.h
> libsvn_wc/upgrade.c tests/libsvn_wc/conflict-data-test.c
> 
> Author: stsp
> Date: Tue Jul  2 10:40:22 2013
> New Revision: 1498873
> 
> URL: http://svn.apache.org/r1498873
> Log:
> Make svn_wc__serialize_conflict() and svn_wc__deserialize_conflict() use
> the
> new conflict description structure (svn_wc_conflict_description3_t).

I'm not sure if this is really what we want here. If we move this forward with the new infrastructure we have to rev it every kind when we upgrade, while it is really only used for providing svn_wc_entry_t to 1.6 style API uers, and for the upgrade from 1.6.

The serialization format here is locked to what we used then, and I don't know if our future in-memory-conflict data will be anything like a struct that can both be read and written.

If we have to keep the compatibility api anyway, we can just use it here and avoid revving all this in future versions.

	Bert