subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1639616 - in /subversion/branches/move-tracking-2/subversion: libsvn_delta/branching.c libsvn_ra/ra_loader.c
Date Fri, 14 Nov 2014 12:10:17 GMT
Author: julianfoad
Date: Fri Nov 14 12:10:16 2014
New Revision: 1639616

URL: http://svn.apache.org/r1639616
Log:
On the 'move-tracking-2' branch: Parse the correct number of branch
instance data blocks.

* subversion/libsvn_delta/branching.c
  (svn_branch_family_parse): Read the number of branch instances.
  (svn_branch_revision_root_parse): Parse that number of instances.
  (svn_branch_family_serialize): Write the number of branch instances.

* subversion/libsvn_ra/ra_loader.c
  (default_repos_info): Update the initial metadata accordingly.

Modified:
    subversion/branches/move-tracking-2/subversion/libsvn_delta/branching.c
    subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/branching.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/branching.c?rev=1639616&r1=1639615&r2=1639616&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branching.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branching.c Fri Nov 14 12:10:16
2014
@@ -994,6 +994,7 @@ svn_branch_instance_parse(svn_branch_ins
 static svn_error_t *
 svn_branch_family_parse(svn_branch_family_t **new_family,
                         int *parent_fid,
+                        int *num_branch_instances,
                         svn_branch_repos_t *repos,
                         svn_stream_t *stream,
                         apr_pool_t *scratch_pool)
@@ -1006,11 +1007,12 @@ svn_branch_family_parse(svn_branch_famil
 
   SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
   SVN_ERR_ASSERT(!eof);
-  n = sscanf(line->data, "f%d: bids %d %d eids %d %d parent-fid %d\n",
+  n = sscanf(line->data, "f%d: bids %d %d eids %d %d "
+                         "parent-fid %d b-instances %d\n",
              &fid,
              &first_bid, &next_bid, &first_eid, &next_eid,
-             parent_fid);
-  SVN_ERR_ASSERT(n == 6);
+             parent_fid, num_branch_instances);
+  SVN_ERR_ASSERT(n == 7);
 
   family = repos_get_family_by_id(repos, fid);
   if (family)
@@ -1073,14 +1075,16 @@ svn_branch_revision_root_parse(svn_branc
   for (i = 0; i < *next_fid_p; i++)
     {
       svn_branch_family_t *family;
-      int bid, parent_fid;
+      int parent_fid, num_branch_instances;
+      int j;
 
-      SVN_ERR(svn_branch_family_parse(&family, &parent_fid, repos, stream,
+      SVN_ERR(svn_branch_family_parse(&family,
+                                      &parent_fid, &num_branch_instances,
+                                      repos, stream,
                                       scratch_pool));
 
       /* parse the branches */
-      /* ### Need to iterate over N(instances) not over N(sibling-defs) */
-      for (bid = family->first_bid; bid < family->next_bid; ++bid)
+      for (j = 0; j < num_branch_instances; j++)
         {
           svn_branch_instance_t *branch;
 
@@ -1158,15 +1162,10 @@ svn_branch_family_serialize(svn_stream_t
                             int parent_fid,
                             apr_pool_t *scratch_pool)
 {
+  apr_array_header_t *branch_instances
+    = apr_array_make(scratch_pool, 0, sizeof(void *));
   int i;
 
-  SVN_ERR(svn_stream_printf(stream, scratch_pool,
-                            "f%d: bids %d %d eids %d %d parent-fid %d\n",
-                            family->fid,
-                            family->first_bid, family->next_bid,
-                            family->first_eid, family->next_eid,
-                            parent_fid));
-
   for (i = 0; i < rev_root->branch_instances->nelts; i++)
     {
       svn_branch_instance_t *branch
@@ -1174,10 +1173,27 @@ svn_branch_family_serialize(svn_stream_t
 
       if (branch->sibling_defn->family == family)
         {
-          SVN_ERR(svn_branch_instance_serialize(stream, branch, scratch_pool));
+          APR_ARRAY_PUSH(branch_instances, void *) = branch;
         }
     }
 
+  SVN_ERR(svn_stream_printf(stream, scratch_pool,
+                            "f%d: bids %d %d eids %d %d "
+                            "parent-fid %d b-instances %d\n",
+                            family->fid,
+                            family->first_bid, family->next_bid,
+                            family->first_eid, family->next_eid,
+                            parent_fid,
+                            branch_instances->nelts));
+
+  for (i = 0; i < branch_instances->nelts; i++)
+    {
+      svn_branch_instance_t *branch
+        = APR_ARRAY_IDX(branch_instances, i, void *);
+
+      SVN_ERR(svn_branch_instance_serialize(stream, branch, scratch_pool));
+    }
+
   for (i = 0; i < family->sub_families->nelts; i++)
     {
       svn_branch_family_t *f = APR_ARRAY_IDX(family->sub_families, i, void *);

Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c?rev=1639616&r1=1639615&r2=1639616&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c Fri Nov 14 12:10:16
2014
@@ -705,7 +705,7 @@ svn_error_t *svn_ra_rev_prop(svn_ra_sess
 /* The default branching metadata for a new repository. */
 static const char *default_repos_info
   = "r0: fids 0 1 root-fid 0\n"
-    "f0: bids 0 1 eids 0 1 parent-fid -1\n"
+    "f0: bids 0 1 eids 0 1 parent-fid -1 b-instances 1\n"
     "f0b0: root-eid 0 at .\n"
     "f0b0e0: -1 . .\n";
 



Mime
View raw message