You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/05/14 12:00:38 UTC

svn commit: r944182 - in /subversion/trunk: configure.ac subversion/libsvn_subr/version.c subversion/tests/libsvn_subr/compat-test.c

Author: philip
Date: Fri May 14 10:00:37 2010
New Revision: 944182

URL: http://svn.apache.org/viewvc?rev=944182&view=rev
Log:
Add a configure option to make it easier to test backward compatibility
using development builds.

* configure.ac: Add --disable-full-version-match and
   SVN_DISABLE_FULL_VERSION_MATCH.

* subversion/libsvn_subr/version.c
  (svn_ver_compat): Relax rules when SVN_DISABLE_FULL_VERSION_MATCH is set.

* subversion/tests/libsvn_subr/compat-test.c
  (test_version_compatibility): Tweak expected outcomes if
   SVN_DISABLE_FULL_VERSION_MATCH is set.

Modified:
    subversion/trunk/configure.ac
    subversion/trunk/subversion/libsvn_subr/version.c
    subversion/trunk/subversion/tests/libsvn_subr/compat-test.c

Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=944182&r1=944181&r2=944182&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Fri May 14 10:00:37 2010
@@ -907,6 +907,17 @@ elif test "$enable_debugging" = "no" ; t
 #   # do nothing
 fi
 
+AC_ARG_ENABLE(full-version-match,
+AS_HELP_STRING([--disable-full-version-match],
+               [Disable the full version match rules when checking
+                Subversion library compatibility.]),
+[
+    if test "$enableval" = "no" ; then
+      AC_MSG_NOTICE([Disabling svn full version matching])
+      AC_DEFINE(SVN_DISABLE_FULL_VERSION_MATCH, 1,
+                [Defined if the full version matching rules are disabled])
+    fi
+])
 
 AC_ARG_WITH(editor,
 AS_HELP_STRING([--with-editor=PATH],

Modified: subversion/trunk/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/version.c?rev=944182&r1=944181&r2=944182&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/version.c (original)
+++ subversion/trunk/subversion/libsvn_subr/version.c Fri May 14 10:00:37 2010
@@ -38,6 +38,13 @@ svn_subr_version(void)
 svn_boolean_t svn_ver_compatible(const svn_version_t *my_version,
                                  const svn_version_t *lib_version)
 {
+  /* With normal development builds the matching rules are strict, to
+     avoid inadvertantly using the wrong libraries.  For backward
+     compatibility testing use --disable-full-version-match to
+     configure 1.7 and then the libraries that get built can be used
+     to replace those in 1.6 or earlier builds.  */
+
+#ifndef SVN_DISABLE_FULL_VERSION_MATCH
   if (lib_version->tag[0] != '\0')
     /* Development library; require exact match. */
     return svn_ver_equal(my_version, lib_version);
@@ -47,10 +54,11 @@ svn_boolean_t svn_ver_compatible(const s
     return (my_version->major == lib_version->major
             && my_version->minor == lib_version->minor
             && my_version->patch > lib_version->patch);
-  else
-    /* General compatibility rules for released versions. */
-    return (my_version->major == lib_version->major
-            && my_version->minor <= lib_version->minor);
+#endif
+
+  /* General compatibility rules for released versions. */
+  return (my_version->major == lib_version->major
+          && my_version->minor <= lib_version->minor);
 }
 
 

Modified: subversion/trunk/subversion/tests/libsvn_subr/compat-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/compat-test.c?rev=944182&r1=944181&r2=944182&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/compat-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/compat-test.c Fri May 14 10:00:37 2010
@@ -27,6 +27,13 @@
 #include "svn_version.h"
 
 #include "../svn_test.h"
+#include "svn_private_config.h"
+
+#ifndef SVN_DISABLE_FULL_VERSION_MATCH
+#define FALSE_IF_FULL FALSE
+#else
+#define FALSE_IF_FULL TRUE
+#endif
 
 static svn_error_t *
 test_version_compatibility(apr_pool_t *pool)
@@ -55,16 +62,16 @@ test_version_compatibility(apr_pool_t *p
     { {1, 0, 1, "dev"}, {1, 0, 1, "dev"}, TRUE },
     { {1, 1, 0, "dev"}, {1, 1, 0, "dev"}, TRUE },
     { {1, 1, 1, "dev"}, {1, 1, 1, "dev"}, TRUE },
-    { {1, 0, 0, "dev"}, {1, 0, 1, "dev"}, FALSE },
-    { {1, 0, 0, "dev"}, {1, 1, 0, "dev"}, FALSE },
-    { {1, 0, 0, "cev"}, {1, 0, 0, "dev"}, FALSE },
-    { {1, 0, 0, "eev"}, {1, 0, 0, "dev"}, FALSE },
-    { {1, 0, 1, "dev"}, {1, 0, 0, "dev"}, FALSE },
+    { {1, 0, 0, "dev"}, {1, 0, 1, "dev"}, FALSE_IF_FULL },
+    { {1, 0, 0, "dev"}, {1, 1, 0, "dev"}, FALSE_IF_FULL },
+    { {1, 0, 0, "cev"}, {1, 0, 0, "dev"}, FALSE_IF_FULL },
+    { {1, 0, 0, "eev"}, {1, 0, 0, "dev"}, FALSE_IF_FULL },
+    { {1, 0, 1, "dev"}, {1, 0, 0, "dev"}, FALSE_IF_FULL },
     { {1, 1, 0, "dev"}, {1, 0, 0, "dev"}, FALSE },
 
-    { {1, 0, 0, ""},    {1, 0, 0, "dev"}, FALSE },
+    { {1, 0, 0, ""},    {1, 0, 0, "dev"}, FALSE_IF_FULL },
 
-    { {1, 0, 0, "dev"}, {1, 0, 0, ""}, FALSE },
+    { {1, 0, 0, "dev"}, {1, 0, 0, ""}, FALSE_IF_FULL },
     { {1, 0, 1, "dev"}, {1, 0, 0, ""}, TRUE },
     { {1, 1, 0, "dev"}, {1, 0, 0, ""}, FALSE },
     { {1, 1, 1, "dev"}, {1, 1, 0, ""}, TRUE },