subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1166098 - /subversion/trunk/subversion/libsvn_repos/dump.c
Date Wed, 07 Sep 2011 10:26:50 GMT
Author: danielsh
Date: Wed Sep  7 10:26:49 2011
New Revision: 1166098

URL: http://svn.apache.org/viewvc?rev=1166098&view=rev
Log:
Make 'svnadmin dump' print the following warning:

    WARNING 0x0001: Mergeinfo referencing revision(s) prior to the
    oldest dumped revision (4). Loading this dump may result in invalid
    mergeinfo.
    WARNING 0x0001: Future instances of this warning will be suppressed

only once per dump operation, rather once per affected node.  The
repetition is deemed more noisy than useful.  (There is already
a warning at the end pointing the existence of warnings throughout
the dump.)

At a high level, this makes dump.c store the 'saw it' bit per dump operation
(in stack storage pointed to by the edit baton) instead of per-revision (in
the edit baton).

* subversion/libsvn_repos/dump.c:
  (struct edit_baton):
    Change type members FOUND_OLD_REFERENCE and FOUND_OLD_MERGEINFO to be
    pointers-to-booleans.
  (dump_node):
    Check the 'saw it' bit before generating the notification/warning.
    Track 'struct edit_baton' changes, allowing for NULL.
  (get_dump_editor):
    Take FOUND_OLD_REFERENCE and FOUND_OLD_MERGEINFO and populate the baton
    with them.
  (svn_repos_dump_fs3): 
    Pass FOUND_OLD_REFERENCE and FOUND_OLD_MERGEINFO.
  (svn_repos_verify_fs2):
    Pass NULL for FOUND_OLD_REFERENCE and FOUND_OLD_MERGEINFO.

Modified:
    subversion/trunk/subversion/libsvn_repos/dump.c

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1166098&r1=1166097&r2=1166098&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Wed Sep  7 10:26:49 2011
@@ -116,11 +116,11 @@ struct edit_baton
 
   /* Set to true if any references to revisions older than
      OLDEST_DUMPED_REV were found in the dumpstream. */
-  svn_boolean_t found_old_reference;
+  svn_boolean_t *found_old_reference;
 
   /* Set to true if any mergeinfo was dumped which contains revisions
      older than OLDEST_DUMPED_REV. */
-  svn_boolean_t found_old_mergeinfo;
+  svn_boolean_t *found_old_mergeinfo;
 
   /* reusable buffer for writing file contents */
   char buffer[SVN__STREAM_CHUNK_SIZE];
@@ -389,7 +389,8 @@ dump_node(struct edit_baton *eb,
                        " into an empty repository"
                        " will fail."),
                      cmp_rev, eb->oldest_dumped_rev);
-              eb->found_old_reference = TRUE;
+              if (eb->found_old_reference)
+                *eb->found_old_reference = TRUE;
               eb->notify_func(eb->notify_baton, notify, pool);
             }
 
@@ -480,7 +481,8 @@ dump_node(struct edit_baton *eb,
                 &old_mergeinfo, mergeinfo,
                 eb->oldest_dumped_rev - 1, 0,
                 TRUE, pool, pool));
-              if (apr_hash_count(old_mergeinfo))
+              if ((eb->found_old_mergeinfo && ! *eb->found_old_mergeinfo)
+                  && apr_hash_count(old_mergeinfo))
                 {
                   svn_repos_notify_t *notify =
                     svn_repos_notify_create(svn_repos_notify_warning, pool);
@@ -493,8 +495,10 @@ dump_node(struct edit_baton *eb,
                       "Loading this dump may result in invalid "
                       "mergeinfo."),
                     eb->oldest_dumped_rev);
+                  notify->last_warning = TRUE;
 
-                  eb->found_old_mergeinfo = TRUE;
+                  if (eb->found_old_mergeinfo)
+                    *eb->found_old_mergeinfo = TRUE;
                   eb->notify_func(eb->notify_baton, notify, pool);
                 }
             }
@@ -863,6 +867,8 @@ get_dump_editor(const svn_delta_editor_t
                 svn_revnum_t oldest_dumped_rev,
                 svn_boolean_t use_deltas,
                 svn_boolean_t verify,
+                svn_boolean_t *found_old_reference,
+                svn_boolean_t *found_old_mergeinfo,
                 apr_pool_t *pool)
 {
   /* Allocate an edit baton to be stored in every directory baton.
@@ -882,6 +888,8 @@ get_dump_editor(const svn_delta_editor_t
   eb->current_rev = to_rev;
   eb->use_deltas = use_deltas;
   eb->verify = verify;
+  eb->found_old_reference = found_old_reference;
+  eb->found_old_mergeinfo = found_old_mergeinfo;
 
   /* Set up the editor. */
   dump_editor->open_root = open_root;
@@ -1094,7 +1102,9 @@ svn_repos_dump_fs3(svn_repos_t *repos,
       use_deltas_for_rev = use_deltas && (incremental || i != start_rev);
       SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton, fs, to_rev,
                               "", stream, notify_func, notify_baton,
-                              start_rev, use_deltas_for_rev, FALSE, subpool));
+                              start_rev, use_deltas_for_rev, FALSE, 
+                              &found_old_reference, &found_old_mergeinfo,
+                              subpool));
 
       /* Drive the editor in one way or another. */
       SVN_ERR(svn_fs_revision_root(&to_root, fs, to_rev, subpool));
@@ -1133,9 +1143,9 @@ svn_repos_dump_fs3(svn_repos_t *repos,
 
       if (dump_edit_baton) /* We never get an edit baton for r0. */
         {
-          if (((struct edit_baton *)dump_edit_baton)->found_old_reference)
+          if (*((struct edit_baton *)dump_edit_baton)->found_old_reference)
             found_old_reference = TRUE;
-          if (((struct edit_baton *)dump_edit_baton)->found_old_mergeinfo)
+          if (*((struct edit_baton *)dump_edit_baton)->found_old_mergeinfo)
             found_old_mergeinfo = TRUE;
         }
     }
@@ -1310,6 +1320,7 @@ svn_repos_verify_fs2(svn_repos_t *repos,
                               notify_func, notify_baton,
                               start_rev,
                               FALSE, TRUE, /* use_deltas, verify */
+                              NULL, NULL,
                               iterpool));
       dump_editor->close_directory = verify_close_directory;
       SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,



Mime
View raw message