subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabh...@apache.org
Subject svn commit: r1492238 - in /subversion/branches/verify-keep-going/subversion: include/svn_error_codes.h include/svn_repos.h libsvn_repos/dump.c svnadmin/svnadmin.c tests/cmdline/svnadmin_tests.py
Date Wed, 12 Jun 2013 15:18:16 GMT
Author: prabhugs
Date: Wed Jun 12 15:18:15 2013
New Revision: 1492238

URL: http://svn.apache.org/r1492238
Log:
Formatting changes and no functional change except for the test-case.

* subversion/include/svn_error_codes.h
  Change "Repository has corruptions" to "Repository is corrupt", just
  a format change

* subversion/include/svn_repos.h
  (svn_repos_notify_t): Doc string change.
  (svn_repos_verify_fs3): Doc string change.

* subversion/libsvn_repos/dump.c
  (notify_verification_error): No functional change.
  verify_one_revision) Rename scratchpool to scratch_pool.

* subversion/svnadmin/svnadmin.c
  (repos_notify_handler): Formatting changes, no functional change.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_keep_going): Just inject a new junk-line at the end of the rev 2 file
  to corrupt the revision to support future formats.

Suggested by: stsp

Modified:
    subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h
    subversion/branches/verify-keep-going/subversion/include/svn_repos.h
    subversion/branches/verify-keep-going/subversion/libsvn_repos/dump.c
    subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c
    subversion/branches/verify-keep-going/subversion/tests/cmdline/svnadmin_tests.py

Modified: subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h?rev=1492238&r1=1492237&r2=1492238&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h Wed Jun 12
15:18:15 2013
@@ -853,7 +853,7 @@ SVN_ERROR_START
   /** @since New in 1.8. */
   SVN_ERRDEF(SVN_ERR_REPOS_CORRUPTED,
              SVN_ERR_REPOS_CATEGORY_START + 11,
-             "Repository has corruptions")
+             "Repository is corrupt")
 
   /* generic RA errors */
 

Modified: subversion/branches/verify-keep-going/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_repos.h?rev=1492238&r1=1492237&r2=1492238&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_repos.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_repos.h Wed Jun 12 15:18:15
2013
@@ -328,7 +328,7 @@ typedef struct svn_repos_notify_t
 
   /** For #svn_repos_notify_failure, this error chain indicates what
       went wrong during verification.
-      @since New in 1.8. */
+      @since New in 1.9. */
   svn_error_t *err;
 
   /* NOTE: Add new fields at the end to preserve binary compatibility.
@@ -2613,7 +2613,7 @@ svn_repos_info_format(int *repos_format,
  * not notified. Finally, return an error if there were any failures during
  * verification, or SVN_NO_ERROR if there were no failures.
  *
- * @since New in 1.8.
+ * @since New in 1.9.
  */
 svn_error_t *
 svn_repos_verify_fs3(svn_repos_t *repos,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/dump.c?rev=1492238&r1=1492237&r2=1492238&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/dump.c Wed Jun 12 15:18:15
2013
@@ -1339,14 +1339,13 @@ notify_verification_error(svn_revnum_t r
                           void *notify_baton,
                           apr_pool_t *pool)
 {
-  if (notify_func)
-    {
-      svn_repos_notify_t *notify_failure;
-      notify_failure = svn_repos_notify_create(svn_repos_notify_failure, pool);
-      notify_failure->err = err;
-      notify_failure->revision = rev;
-      notify_func(notify_baton, notify_failure, pool);
-    }
+  if (notify_func == NULL)
+    return;
+  svn_repos_notify_t *notify_failure;
+  notify_failure = svn_repos_notify_create(svn_repos_notify_failure, pool);
+  notify_failure->err = err;
+  notify_failure->revision = rev;
+  notify_func(notify_baton, notify_failure, pool);
 }
 
 /* Verify revision REV in file system FS. */
@@ -1358,7 +1357,7 @@ verify_one_revision(svn_fs_t *fs,
                     svn_revnum_t start_rev,
                     svn_cancel_func_t cancel_func,
                     void *cancel_baton,
-                    apr_pool_t *scratchpool)
+                    apr_pool_t *scratch_pool)
 {
   const svn_delta_editor_t *dump_editor;
   void *dump_edit_baton;
@@ -1371,28 +1370,28 @@ verify_one_revision(svn_fs_t *fs,
   /* Get cancellable dump editor, but with our close_directory handler.*/
   SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton,
                           fs, rev, "",
-                          svn_stream_empty(scratchpool),
+                          svn_stream_empty(scratch_pool),
                           NULL, NULL,
                           verify_close_directory,
                           notify_func, notify_baton,
                           start_rev,
                           FALSE, TRUE, /* use_deltas, verify */
-                          scratchpool));
+                          scratch_pool));
   SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
                                             dump_editor, dump_edit_baton,
                                             &cancel_editor,
                                             &cancel_edit_baton,
-                                            scratchpool));
-  SVN_ERR(svn_fs_revision_root(&to_root, fs, rev, scratchpool));
+                                            scratch_pool));
+  SVN_ERR(svn_fs_revision_root(&to_root, fs, rev, scratch_pool));
   SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
                             cancel_editor, cancel_edit_baton,
-                            NULL, NULL, scratchpool));
+                            NULL, NULL, scratch_pool));
  
   /* While our editor close_edit implementation is a no-op, we still
      do this for completeness. */
-  SVN_ERR(cancel_editor->close_edit(cancel_edit_baton, scratchpool));
+  SVN_ERR(cancel_editor->close_edit(cancel_edit_baton, scratch_pool));
  
-  SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, scratchpool));
+  SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1514,8 +1513,8 @@ svn_repos_verify_fs3(svn_repos_t *repos,
       void *cancel_edit_baton;
       svn_fs_root_t *to_root;
       apr_hash_t *props;
-
       svn_error_t *err;
+
       svn_pool_clear(iterpool);
 
       /* Wrapper function to catch the possible errors. */

Modified: subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c?rev=1492238&r1=1492237&r2=1492238&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c Wed Jun 12 15:18:15
2013
@@ -290,7 +290,7 @@ static const apr_getopt_option_t options
      N_("deprecated; see --compatible-version")},
 
     {"keep-going",    svnadmin__keep_going, 0,
-     N_("continue verifying after detecting a corruption")},
+     N_("continue verification after detecting a corruption")},
 
     {"memory-cache-size",     'M', 1,
      N_("size of the extra in-memory cache in MB used to\n"
@@ -830,8 +830,8 @@ repos_notify_handler(void *baton,
     case svn_repos_notify_failure:
       if (notify->revision != SVN_INVALID_REVNUM)
         cmdline_stream_printf(feedback_stream, scratch_pool,
-                               _("* Error verifying revision %ld.\n"),
-                               notify->revision);
+                              _("* Error verifying revision %ld.\n"),
+                              notify->revision);
       if (notify->err)
         svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
                           "svnadmin: ");

Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/svnadmin_tests.py?rev=1492238&r1=1492237&r2=1492238&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/svnadmin_tests.py Wed Jun
12 15:18:15 2013
@@ -1844,41 +1844,8 @@ def verify_keep_going(sbox):
                                      C_url)
   
   r2 = fsfs_file(sbox.repo_dir, 'revs', '2')
-  fp = open(r2, 'wb')
-  fp.write("""id: 0-2.0.r2/0
-type: dir
-count: 0
-cpath: /B
-copyroot: 0 /
-
-PLAIN
-K 1
-A
-V 17
-dir 0-1.0.r1/3837
-K 1
-B
-V 14
-dir 0-2.0.r2/0
-K 4
-iota
-V 19
-file 11-1.0.r1/3951
-END
-ENDREP
-id: 0.0.r2/165
-type: dir
-pred: 0.0.r1/4198
-count: 2
-text: 2 59 93 0 ae352a67fd07433f009f7234d2ea47ac
-cpath: /
-copyroot: 0 /
-
-_0.0.t1-1 Add-dir false false /B
-
-
-165 290
-""")
+  fp = open(r2, 'a')
+  fp.write("""inserting junk to corrupt the rev""")
   fp.close()
   exit_code, output, errput = svntest.main.run_svnadmin("verify",
                                                         "--keep-going",



Mime
View raw message