You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/08/13 15:05:41 UTC

svn commit: r1372413 - in /subversion/branches/inheritable-props: ./ build/ build/ac-macros/ build/generator/templates/ subversion/libsvn_subr/ subversion/tests/cmdline/

Author: pburba
Date: Mon Aug 13 13:05:41 2012
New Revision: 1372413

URL: http://svn.apache.org/viewvc?rev=1372413&view=rev
Log:
On the inheritable-props branch: Sync with ^/subversion/trunk through
r1372409.

Added:
    subversion/branches/inheritable-props/build/ac-macros/macosx.m4
      - copied unchanged from r1372409, subversion/trunk/build/ac-macros/macosx.m4
Modified:
    subversion/branches/inheritable-props/   (props changed)
    subversion/branches/inheritable-props/aclocal.m4
    subversion/branches/inheritable-props/build/generator/templates/svn_config.vcproj.ezt
    subversion/branches/inheritable-props/build/transform_config_hw.py   (props changed)
    subversion/branches/inheritable-props/configure.ac
    subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
    subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py
    subversion/branches/inheritable-props/subversion/tests/cmdline/svnadmin_tests.py

Propchange: subversion/branches/inheritable-props/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1371832-1372409

Modified: subversion/branches/inheritable-props/aclocal.m4
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/aclocal.m4?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/aclocal.m4 (original)
+++ subversion/branches/inheritable-props/aclocal.m4 Mon Aug 13 13:05:41 2012
@@ -46,6 +46,7 @@ sinclude(build/ac-macros/sqlite.m4)
 sinclude(build/ac-macros/swig.m4)
 sinclude(build/ac-macros/zlib.m4)
 sinclude(build/ac-macros/kwallet.m4)
+sinclude(build/ac-macros/macosx.m4)
 
 # Include the libtool macros
 sinclude(build/libtool.m4)

Modified: subversion/branches/inheritable-props/build/generator/templates/svn_config.vcproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/generator/templates/svn_config.vcproj.ezt?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/generator/templates/svn_config.vcproj.ezt (original)
+++ subversion/branches/inheritable-props/build/generator/templates/svn_config.vcproj.ezt Mon Aug 13 13:05:41 2012
@@ -33,7 +33,7 @@
 			Name="[configs]|[platforms]"
 			OutputDirectory="."
 			BuildLogFile="$(IntDir)\BuildLog_$(ProjectName).htm"
-			IntermediateDirectory="..\..\..\$(ConfigurationName)"
+			IntermediateDirectory="..\..\..\[configs]"
 			ConfigurationType="10"
 			UseOfMFC="0"
 			DeleteExtensionsOnClean="*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;$(TargetPath)"
@@ -62,14 +62,14 @@
 			</FileConfiguration>
 [end][end]		</File>
 		<File
-			RelativePath="..\..\subversion\svn_private_config.hw">
+			RelativePath="..\..\..\subversion\svn_private_config.hw">
 [for platforms][for configs]			<FileConfiguration
 				Name="[configs]|[platforms]">
 				<Tool
 					Name="VCCustomBuildTool"
 					Description="Creating svn_private_config.h from svn_private_config.hw."
 					CommandLine="&quot;[svn_python]&quot; &quot;$(SolutionDir)\build\transform_config_hw.py&quot; [platforms] &quot;$(InputPath)&quot; &quot;$(IntDir)\svn_private_config.h&quot;"
-					Outputs="$(IntDir)subversion\svn_private_config.h"/>
+					Outputs="$(IntDir)\svn_private_config.h"/>
 			</FileConfiguration>
 [end][end]		</File>
 [for sql]		<File

Propchange: subversion/branches/inheritable-props/build/transform_config_hw.py
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/inheritable-props/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/configure.ac?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/configure.ac (original)
+++ subversion/branches/inheritable-props/configure.ac Mon Aug 13 13:05:41 2012
@@ -146,7 +146,9 @@ SVN_FIND_APACHE(20020903)
 dnl Search for SQLite
 SQLITE_MINIMUM_VER="3.7.12"
 SQLITE_RECOMMENDED_VER="3.7.12"
-SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-${SQLITE_RECOMMENDED_VER}.tar.gz"
+SQLITE_RECOMMENDED_VER_URL="3071200"
+SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-${SQLITE_RECOMMENDED_VER_URL}.zip"
+
 SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
                ${SQLITE_URL})
 
@@ -477,43 +479,10 @@ if test "$svn_lib_sasl" = "yes"; then
             [Defined if Cyrus SASL v2 is present on the system])
 fi
 
-dnl Mac OS KeyChain -------------------
-
-AC_ARG_ENABLE(keychain,
-  AS_HELP_STRING([--disable-keychain], 
-  [Disable use of Mac OS KeyChain for auth credentials]),
-  [enable_keychain=$enableval],[enable_keychain=yes])
-
-AC_MSG_CHECKING([for Mac OS KeyChain Services])
-
-if test "$enable_keychain" = "yes"; then
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <AvailabilityMacros.h>
-#if !DARWIN || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2)
-#error KeyChain API unavailable.
-#endif]], [[]])],[],[enable_keychain=no])
-fi
-
-if test "$enable_keychain" = "yes"; then
-  dnl ### Hack.  We should only need to pass the -framework options when
-  dnl linking libsvn_subr, since it is the only library that uses Keychain.
-  dnl
-  dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
-  dnl OS X frameworks like it does for normal libraries, so we need to
-  dnl explicitly pass the option to all the users of libsvn_subr to allow
-  dnl static builds to link successfully.
-  dnl
-  dnl This does mean that all executables we link will be linked directly
-  dnl to these frameworks - even when building shared libraries - but that
-  dnl shouldn't cause any problems.
-  LIBS="$LIBS -framework Security"
-  LIBS="$LIBS -framework CoreFoundation"
-  LIBS="$LIBS -framework CoreServices"
-  AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?])
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
+dnl Mac OS soecufuc features -------------------
 
+SVN_LIB_MACOS_PLIST
+SVN_LIB_MACOS_KEYCHAIN
 
 dnl APR_HAS_DSO -------------------
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c Mon Aug 13 13:05:41 2012
@@ -36,6 +36,7 @@
 #include <apr_lib.h>
 #include <apr_pools.h>
 #include <apr_file_info.h>
+#include <apr_strings.h>
 
 #include "svn_ctype.h"
 #include "svn_error.h"
@@ -48,6 +49,10 @@
 #include <sys/utsname.h>
 #endif
 
+#if SVN_HAVE_MACOS_PLIST
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
 #if HAVE_UNAME
 static const char* canonical_host_from_uname(apr_pool_t *pool);
 #endif
@@ -58,6 +63,10 @@ static const char * win32_release_name(a
 static const char * win32_shared_libs(apr_pool_t *pool);
 #endif /* WIN32 */
 
+#if SVN_HAVE_MACOS_PLIST
+static const char *macos_release_name(apr_pool_t *pool);
+#endif  /* SVN_HAVE_MACOS_PLIST */
+
 
 const char *
 svn_sysinfo__canonical_host(apr_pool_t *pool)
@@ -77,6 +86,8 @@ svn_sysinfo__release_name(apr_pool_t *po
 {
 #ifdef WIN32
   return win32_release_name(pool);
+#elif SVN_HAVE_MACOS_PLIST
+  return macos_release_name(pool);
 #else
   return NULL;
 #endif
@@ -461,3 +472,184 @@ win32_shared_libs(apr_pool_t *pool)
   return NULL;
 }
 #endif /* WIN32 */
+
+#if SVN_HAVE_MACOS_PLIST
+/* Load the SystemVersion.plist or ServerVersion.plist file into a
+   property list. Set SERVER to TRUE if the file read was
+   ServerVersion.plist. */
+static CFDictionaryRef
+system_version_plist(svn_boolean_t *server, apr_pool_t *pool)
+{
+  static const UInt8 server_version[] =
+    "/System/Library/CoreServices/ServerVersion.plist";
+  static const UInt8 system_version[] =
+    "/System/Library/CoreServices/SystemVersion.plist";
+
+  CFPropertyListRef plist = NULL;
+  CFDataRef resource = NULL;
+  CFStringRef errstr = NULL;
+  CFURLRef url = NULL;
+  SInt32 errcode;
+
+  url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+                                                server_version,
+                                                sizeof(server_version) - 1,
+                                                FALSE);
+  if (!url)
+    return NULL;
+
+  if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault,
+                                                url, &resource,
+                                                NULL, NULL, &errcode))
+    {
+      CFRelease(url);
+      url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+                                                    system_version,
+                                                    sizeof(system_version) - 1,
+                                                    FALSE);
+      if (!url)
+        return NULL;
+
+      if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault,
+                                                    url, &resource,
+                                                    NULL, NULL, &errcode))
+        {
+          CFRelease(url);
+          return NULL;
+        }
+      else
+        {
+          CFRelease(url);
+          *server = FALSE;
+        }
+    }
+  else
+    {
+      CFRelease(url);
+      *server = TRUE;
+    }
+
+  /* ### CFPropertyListCreateFromXMLData is obsolete, but its
+         replacement CFPropertyListCreateWithData is only available
+         from Mac OS 1.6 onward. */
+  plist = CFPropertyListCreateFromXMLData(kCFAllocatorDefault, resource,
+                                          kCFPropertyListImmutable,
+                                          &errstr);
+  if (resource)
+    CFRelease(resource);
+  if (errstr)
+    CFRelease(errstr);
+
+  if (CFDictionaryGetTypeID() != CFGetTypeID(plist))
+    {
+      /* Oops ... this really should be a dict. */
+      CFRelease(plist);
+      return NULL;
+    }
+
+  return plist;
+}
+
+/* Return the value for KEY from PLIST, or NULL if not available. */
+static const char *
+value_from_dict(CFDictionaryRef plist, CFStringRef key, apr_pool_t *pool)
+{
+  CFStringRef valref;
+  CFIndex bufsize;
+  const void *valptr;
+  const char *value;
+
+  if (!CFDictionaryGetValueIfPresent(plist, key, &valptr))
+    return NULL;
+
+  valref = valptr;
+  if (CFStringGetTypeID() != CFGetTypeID(valref))
+    return NULL;
+
+  value = CFStringGetCStringPtr(valref, kCFStringEncodingUTF8);
+  if (value)
+    return apr_pstrdup(pool, value);
+
+  bufsize =  5 * CFStringGetLength(valref) + 1;
+  value = apr_palloc(pool, bufsize);
+  if (!CFStringGetCString(valref, (char*)value, bufsize,
+                          kCFStringEncodingUTF8))
+    value = NULL;
+
+  return value;
+}
+
+/* Return the commercial name of the OS, given the version number in
+   a format that matches the regular expression /^10\.\d+(\..*)?$/ */
+static const char *
+release_name_from_version(const char *osver)
+{
+  char *end = NULL;
+  unsigned long num = strtoul(osver, &end, 10);
+
+  if (!end || *end != '.' || num != 10)
+    return NULL;
+
+  osver = end + 1;
+  end = NULL;
+  num = strtoul(osver, &end, 10);
+  if (!end || (*end && *end != '.'))
+    return NULL;
+
+  /* See http://en.wikipedia.org/wiki/History_of_OS_X#Release_timeline */
+  switch(num)
+    {
+    case 0: return "Cheetah";
+    case 1: return "Puma";
+    case 2: return "Jaguar";
+    case 3: return "Panther";
+    case 4: return "Tiger";
+    case 5: return "Leopard";
+    case 6: return "Snow Leopard";
+    case 7: return "Lion";
+    case 8: return "Mountain Lion";
+    }
+
+  return NULL;
+}
+
+static const char *
+macos_release_name(apr_pool_t *pool)
+{
+  svn_boolean_t server;
+  CFDictionaryRef plist = system_version_plist(&server, pool);
+
+  if (plist)
+    {
+      const char *osname = value_from_dict(plist, CFSTR("ProductName"), pool);
+      const char *osver = value_from_dict(plist,
+                                          CFSTR("ProductUserVisibleVersion"),
+                                          pool);
+      const char *build = value_from_dict(plist,
+                                          CFSTR("ProductBuildVersion"),
+                                          pool);
+      const char *release;
+
+      if (!osver)
+        osver = value_from_dict(plist, CFSTR("ProductVersion"), pool);
+      release = release_name_from_version(osver);
+
+      CFRelease(plist);
+      return apr_psprintf(pool, "%s%s%s%s%s%s%s%s",
+                          (osname ? osname : ""),
+                          (osver ? (osname ? " " : "") : ""),
+                          (osver ? osver : ""),
+                          (release ? (osname||osver ? " " : "") : ""),
+                          (release ? release : ""),
+                          (build
+                           ? (osname||osver||release ? ", " : "")
+                           : ""),
+                          (build
+                           ? (server ? "server build " : "build ")
+                           : ""),
+                          (build ? build : ""));
+    }
+
+  return NULL;
+}
+#endif  /* SVN_HAVE_MACOS_PLIST */

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/merge_tests.py Mon Aug 13 13:05:41 2012
@@ -11060,7 +11060,6 @@ def reverse_merge_away_all_mergeinfo(sbo
 # merge'.  Specifically see
 # http://subversion.tigris.org/issues/show_bug.cgi?id=3067#desc5
 @SkipUnless(server_has_mergeinfo)
-@XFail()
 @Issues(3138,3067,4217)
 def dont_merge_revs_into_subtree_that_predate_it(sbox):
   "dont merge revs into a subtree that predate it"
@@ -11191,13 +11190,12 @@ def dont_merge_revs_into_subtree_that_pr
                                      H_COPY_path)
 
   # H_COPY needs r6-9 applied while H_COPY/nu needs only 6,8-9.
-  # This means r6 will be done as a separate editor drive targeted
-  # on H_COPY.  But r6 was only the copy of A/D/H to H_COPY and
-  # so is a no-op and there will no notification for r6.
   svntest.actions.run_and_verify_svn(
     None,
     expected_merge_output(
-      [[6,9]], ['U    ' + os.path.join(H_COPY_path, "psi") + '\n',
+      [[7,9],  # Merge notification
+       [6,9]], # Mergeinfo notification
+               ['U    ' + os.path.join(H_COPY_path, "psi") + '\n',
                 'D    ' + os.path.join(H_COPY_path, "nu") + '\n',
                 ' U   ' + H_COPY_path + '\n',]),
     [], 'merge', sbox.repo_url + '/A/D/H', H_COPY_path, '--force')

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/svnadmin_tests.py?rev=1372413&r1=1372412&r2=1372413&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/svnadmin_tests.py Mon Aug 13 13:05:41 2012
@@ -1821,6 +1821,11 @@ def mergeinfo_race(sbox):
     raise svntest.Failure("one or both commits failed")
 
 
+@Issue(4213)
+def recover_old(sbox):
+  "recover --pre-1.4-compatible"
+  sbox.build(create_wc=False)
+  svntest.main.run_svnadmin("recover", sbox.repo_dir)
 
 
 ########################################################################
@@ -1858,6 +1863,7 @@ test_list = [ None,
               hotcopy_incremental_packed,
               locking,
               mergeinfo_race,
+              recover_old,
              ]
 
 if __name__ == '__main__':