subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1296034 - in /subversion/trunk/subversion: include/svn_editor.h libsvn_delta/editor.c
Date Fri, 02 Mar 2012 02:33:22 GMT
Author: hwright
Date: Fri Mar  2 02:33:21 2012
New Revision: 1296034

URL: http://svn.apache.org/viewvc?rev=1296034&view=rev
Log:
Document the expected checksum kind for use with the editor.

* subversion/include/svn_editor.h
  (SVN_EDITOR_CHECKSUM_KIND): New.

* subversion/libsvn_delta/editor.c
  (svn_editor_add_file, svn_editor_alter_file): Assert that we have the correct
    checksum kind.

Modified:
    subversion/trunk/subversion/include/svn_editor.h
    subversion/trunk/subversion/libsvn_delta/editor.c

Modified: subversion/trunk/subversion/include/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_editor.h?rev=1296034&r1=1296033&r2=1296034&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_editor.h (original)
+++ subversion/trunk/subversion/include/svn_editor.h Fri Mar  2 02:33:21 2012
@@ -383,6 +383,13 @@ extern "C" {
  */
 typedef struct svn_editor_t svn_editor_t;
 
+/** The kind of the checksum to be used throughout the 
+ *
+ * @note ### This may change before Ev2 is official released, so just like
+ * everything else in this file, please don't rely upon it until then.
+ */
+#define SVN_EDITOR_CHECKSUM_KIND svn_checksum_sha1
+
 
 /** These function types define the callback functions a tree delta consumer
  * implements.

Modified: subversion/trunk/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/editor.c?rev=1296034&r1=1296033&r2=1296034&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/editor.c (original)
+++ subversion/trunk/subversion/libsvn_delta/editor.c Fri Mar  2 02:33:21 2012
@@ -420,7 +420,8 @@ svn_editor_add_file(svn_editor_t *editor
 {
   svn_error_t *err = SVN_NO_ERROR;
 
-  SVN_ERR_ASSERT(checksum != NULL);
+  SVN_ERR_ASSERT(checksum != NULL
+                    && checksum->kind == SVN_EDITOR_CHECKSUM_KIND);
   SVN_ERR_ASSERT(contents != NULL);
   SVN_ERR_ASSERT(props != NULL);
   SHOULD_NOT_BE_FINISHED(editor);
@@ -539,6 +540,8 @@ svn_editor_alter_file(svn_editor_t *edit
   SVN_ERR_ASSERT((checksum != NULL && contents != NULL)
                  || (checksum == NULL && contents == NULL));
   SVN_ERR_ASSERT(props != NULL || checksum != NULL);
+  if (checksum)
+    SVN_ERR_ASSERT(checksum->kind == SVN_EDITOR_CHECKSUM_KIND);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ALTER(editor, relpath);
 



Mime
View raw message