[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Don't repeatedly notify the same warning

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Sun, 28 Aug 2011 16:08:49 +0300

[[[
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.

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.)

* subversion/libsvn_repos/dump.c:
  (TBD):
    Store the 'saw it' bit, not per-revision (in the edit baton) but per
    dump operation (in stack storage pointed to by the edit baton).
  (dump_node):
    Check the bit before generating the notification/warning.
]]]

[[[
Index: subversion/libsvn_repos/dump.c
===================================================================
--- subversion/libsvn_repos/dump.c (revision 1162490)
+++ subversion/libsvn_repos/dump.c (working copy)
@@ -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,7 @@ dump_node(struct edit_baton *eb,
                        " into an empty repository"
                        " will fail."),
                      cmp_rev, eb->oldest_dumped_rev);
- eb->found_old_reference = TRUE;
+ *eb->found_old_reference = TRUE;
               eb->notify_func(eb->notify_baton, notify, pool);
             }
 
@@ -480,7 +480,7 @@ 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 && apr_hash_count(old_mergeinfo))
                 {
                   svn_repos_notify_t *notify =
                     svn_repos_notify_create(svn_repos_notify_warning, pool);
@@ -494,7 +494,7 @@ dump_node(struct edit_baton *eb,
                       "mergeinfo."),
                     eb->oldest_dumped_rev);
 
- eb->found_old_mergeinfo = TRUE;
+ *eb->found_old_mergeinfo = TRUE;
                   eb->notify_func(eb->notify_baton, notify, pool);
                 }
             }
@@ -863,6 +863,8 @@ get_dump_editor(const svn_delta_editor_t **editor,
                 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 +884,8 @@ get_dump_editor(const svn_delta_editor_t **editor,
   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 +1098,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));
@@ -1310,6 +1316,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,

]]]
Received on 2011-08-28 15:10:12 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.