Author: danielsh
Date: Fri Apr 5 14:47:37 2013
New Revision: 1464993
URL: http://svn.apache.org/r1464993
Log:
'svnadmin info': sketch the public API.
Declare the new APIs:
* subversion/include/svn_fs.h
(svn_fs_info, svn_fs_info_t, svn_fs_info_dup): New.
* subversion/include/svn_repos.h
(svn_repos_info, svn_repos_info_t, svn_repos_info_dup): New.
(svn_repos_capabilities): New.
And provide "Not implemented" definitions:
* subversion/libsvn_fs/fs-loader.c
(svn_fs_info, svn_fs_info_dup): Dummy implementations.
* subversion/libsvn_repos/repos.c
(svn_repos_info, svn_repos_info_dup): Dummy implementations.
(svn_repos_capabilities): Dummy implementation.
Modified:
subversion/trunk/subversion/include/svn_fs.h
subversion/trunk/subversion/include/svn_repos.h
subversion/trunk/subversion/libsvn_fs/fs-loader.c
subversion/trunk/subversion/libsvn_repos/repos.c
Modified: subversion/trunk/subversion/include/svn_fs.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1464993&r1=1464992&r2=1464993&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Fri Apr 5 14:47:37 2013
@@ -2500,6 +2500,98 @@ svn_fs_verify_root(svn_fs_root_t *root,
/** @} */
+/**
+ * @defgroup fs_info Filesystem information subsystem
+ * @{
+ */
+
+/**
+ * A structure that provides some information about a filesystem.
+ * Returned by svn_fs_info().
+ *
+ * @note Fields may be added to the end of this structure in future
+ * versions. Therefore, users shouldn't allocate structures of this
+ * type, to preserve binary compatibility.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_fs_info_t {
+
+ /** @see svn_fs_type() */
+ const char *fs_type;
+
+ /** @see svn_fs_get_uuid() */
+ const char *uuid;
+
+ /** @see svn_fs_youngest_rev() */
+ svn_revnum_t youngest;
+
+ /** Filesystem format number: an integer that increases when incompatible
+ * changes are made (such as by #svn_fs_upgrade). */
+ int fs_format;
+
+ /** The oldest Subversion GA release that can read and write this
+ * filesystem. */
+ svn_version_t *supports_version;
+
+#if 0
+ /* Potential future feature. */
+ svn_boolean_t is_write_locked;
+#endif
+
+ /** Filesystem backend (#fs_type) -specific information.
+ * @see SVN_FS_FSFS_INFO_* */
+ apr_hash_t *fsap_info;
+
+ /** List of user-serviceable config files.
+ * Elements are dirents (as const char *). */
+ apr_array_header_t *config_files;
+
+} svn_fs_info_t;
+
+/**
+ * Set @a *info to an info struct describing @a fs.
+ *
+ * @see #svn_fs_info_t
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_fs_info(const svn_fs_info_t **info,
+ svn_fs_t *fs,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return a duplicate of @a info, allocated in @a pool. No part of the new
+ * structure will be shared with @a info.
+ *
+ * @since New in 1.8.
+ */
+svn_fs_info_t *
+svn_fs_info_dup(const svn_fs_info_t *info,
+ apr_pool_t *result_pool);
+
+/** @name FSFS-specific #svn_fs_info_t information.
+ * @since New in 1.8.
+ * @{
+ */
+
+/** Value: shard size (as int), or 0 if the filesystem is
+ * not currently sharded. */
+#define SVN_FS_FSFS_INFO_SHARDED "sharded"
+
+/** Value: abspath to rep-cache.db, or absent if that doesn't exist.
+ @note Do not modify the db schema or tables!
+ */
+#define SVN_FS_FSFS_INFO_REP_CACHE_PATH "rep-cache-path"
+
+/** The smallest revision (as #svn_revnum_t) which is not in a pack file.
+ * @note Zero (0) if (but not iff) the format does not support packing. */
+#define SVN_FS_FSFS_INFO_MIN_UNPACKED_REV "min-unpacked-rev"
+/** @} */
+
+/** @} */
#ifdef __cplusplus
}
Modified: subversion/trunk/subversion/include/svn_repos.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1464993&r1=1464992&r2=1464993&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Fri Apr 5 14:47:37 2013
@@ -495,6 +495,26 @@ svn_repos_has_capability(svn_repos_t *re
apr_pool_t *pool);
/**
+ * Return a set capabilities supported by the running Subversion library and by
+ * @a repos. (Capabilities supported by this version of Subversion but not by
+ * @a repos are not listed. This may happen when svn_repos_upgrade2() has not
+ * been called after a software upgrade.)
+ *
+ * The set is represented as a hash whose keys are the set members. The values
+ * are not defined.
+ *
+ * @see svn_repos_info()
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_repos_capabilities(apr_hash_t **capabilities,
+ svn_repos_t *repos,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+/** @} */
+
+/**
* The capability of doing the right thing with merge-tracking
* information, both storing it and responding to queries about it.
*
@@ -3387,6 +3407,76 @@ svn_repos_remember_client_capabilities(s
const apr_array_header_t *capabilities);
+
+/** Info. **/
+/**
+ * @defgroup repos_info Repository information subsystem
+ * @{
+ */
+
+/**
+ * A structure that provides some information about a repository.
+ * Returned by svn_repos_info().
+ *
+ * @note Fields may be added to the end of this structure in future
+ * versions. Therefore, users shouldn't allocate structures of this
+ * type, to preserve binary compatibility.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_repos_info_t {
+
+ /** Repository format number: an integer that increases when incompatible
+ * changes are made (such as by #svn_repos_upgrade). */
+ int repos_format;
+
+ /** The oldest Subversion GA release that can read and write this
+ * repository. */
+ svn_version_t *supports_version;
+
+ /** Set of basenames of hook scripts which have been installed.
+ * Keys are C strings such as "post-commit", values are undefined. */
+ apr_hash_t *hooks_enabled;
+
+ /** Set of basenames of hook scripts which are respected by this version of
+ * Subversion. Keys are C strings such as "post-commit", values are
+ * undefined.
+ *
+ * @note Hooks are sometimes extended (e.g., by passing additional arguments
+ * to them). In the future we might extend the semantics of this hash to
+ * describe that case, for example by adding keys or defining a meaning for
+ * the values.
+ */
+ apr_hash_t *hooks_known;
+
+ /** @see svn_fs_info(), svn_repos_fs() */
+ svn_fs_info_t *fs_info;
+
+} svn_repos_info_t;
+
+/**
+ * Set @a *info to an info struct describing @a repos.
+ *
+ * @see #svn_repos_info_t, svn_repos_capabilities()
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_repos_info(const svn_repos_info_t **info,
+ svn_repos_t *repos,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return a duplicate of @a info, allocated in @a pool. No part of the new
+ * structure will be shared with @a info.
+ *
+ * @since New in 1.8.
+ */
+svn_repos_info_t *
+svn_repos_info_dup(const svn_repos_info_t *info,
+ apr_pool_t *result_pool);
+
#ifdef __cplusplus
}
Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1464993&r1=1464992&r2=1464993&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Fri Apr 5 14:47:37 2013
@@ -1590,3 +1590,24 @@ svn_fs_version(void)
{
SVN_VERSION_BODY;
}
+
+
+/** info **/
+svn_error_t *
+svn_fs_info(const svn_fs_info_t **info,
+ svn_fs_t *fs,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ SVN__NOT_IMPLEMENTED();
+}
+
+svn_fs_info_t *
+svn_fs_info_dup(const svn_fs_info_t *info,
+ apr_pool_t *result_pool)
+{
+ /* Not implemented. */
+ SVN_ERR_MALFUNCTION_NO_RETURN();
+ return NULL;
+}
+
Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1464993&r1=1464992&r2=1464993&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Fri Apr 5 14:47:37 2013
@@ -1677,6 +1677,15 @@ svn_repos_has_capability(svn_repos_t *re
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_repos_capabilities(apr_hash_t **capabilities,
+ svn_repos_t *repos,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ SVN__NOT_IMPLEMENTED();
+}
+
svn_fs_t *
svn_repos_fs(svn_repos_t *repos)
@@ -2131,3 +2140,23 @@ svn_repos__fs_type(const char **fs_type,
svn_dirent_join(repos_path, SVN_REPOS__DB_DIR, pool),
pool);
}
+
+
+/** info **/
+svn_error_t *
+svn_repos_info(const svn_repos_info_t **info,
+ svn_repos_t *repos,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ SVN__NOT_IMPLEMENTED();
+}
+
+svn_repos_info_t *
+svn_repos_info_dup(const svn_repos_info_t *info,
+ apr_pool_t *result_pool)
+{
+ /* Not implemented. */
+ SVN_ERR_MALFUNCTION_NO_RETURN();
+ return NULL;
+}