subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r938483 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db_pdh.h
Date Tue, 27 Apr 2010 14:51:34 GMT
Author: hwright
Date: Tue Apr 27 14:51:33 2010
New Revision: 938483

URL: http://svn.apache.org/viewvc?rev=938483&view=rev
Log:
Add a new header file, and move the a few type declarations from wc_db.c to
that header file.  Also, use from preprocessor magic to ensure that other files
do not use these data structures.

* subversion/libsvn_wc/wc_db.c
  Include the require define, and the new header file.
  (svn_wc__db_t, svn_wc__db_wcroot_t, svn_wc__db_pdh_t): Move from here...

* subversion/libsvn_wc/wc_db_pdh.h:
  (svn_wc__db_t, svn_wc__db_wcroot_t, svn_wc__db_pdh_t): ...to here.

Added:
    subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h   (with props)
Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=938483&r1=938482&r2=938483&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Apr 27 14:51:33 2010
@@ -21,6 +21,8 @@
  * ====================================================================
  */
 
+#define SVN_WC__I_AM_WC_DB
+
 #include <assert.h>
 #include <apr_pools.h>
 #include <apr_hash.h>
@@ -40,6 +42,7 @@
 #include "entries.h"
 #include "lock.h"
 #include "tree_conflicts.h"
+#include "wc_db_pdh.h"
 
 #include "svn_private_config.h"
 #include "private/svn_sqlite.h"
@@ -102,80 +105,6 @@
 #define FORMAT_FROM_SDB (-1)
 
 
-struct svn_wc__db_t {
-  /* What's the appropriate mode for this datastore? */
-  svn_wc__db_openmode_t mode;
-
-  /* We need the config whenever we run into a new WC directory, in order
-     to figure out where we should look for the corresponding datastore. */
-  svn_config_t *config;
-
-  /* Should we attempt to automatically upgrade the database when it is
-     opened, and found to be not-current?  */
-  svn_boolean_t auto_upgrade;
-
-  /* Should we ensure the WORK_QUEUE is empty when a WCROOT is opened?  */
-  svn_boolean_t enforce_empty_wq;
-
-  /* Map a given working copy directory to its relevant data.
-     const char *local_abspath -> svn_wc__db_pdh_t *pdh  */
-  apr_hash_t *dir_data;
-
-  /* As we grow the state of this DB, allocate that state here. */
-  apr_pool_t *state_pool;
-};
-
-/** Hold information about a WCROOT.
- *
- * This structure is referenced by all per-directory handles underneath it.
- */
-typedef struct {
-  /* Location of this wcroot in the filesystem.  */
-  const char *abspath;
-
-  /* The SQLite database containing the metadata for everything in
-     this wcroot.  */
-  svn_sqlite__db_t *sdb;
-
-  /* The WCROOT.id for this directory (and all its children).  */
-  apr_int64_t wc_id;
-
-  /* The format of this wcroot's metadata storage (see wc.h). If the
-     format has not (yet) been determined, this will be UNKNOWN_FORMAT.  */
-  int format;
-
-} svn_wc__db_wcroot_t;
-
-/**  Pristine Directory Handle
- *
- * This structure records all the information that we need to deal with
- * a given working copy directory.
- */
-typedef struct svn_wc__db_pdh_t {
-  /* This (versioned) working copy directory is obstructing what *should*
-     be a file in the parent directory (according to its metadata).
-
-     Note: this PDH should probably be ignored (or not created).
-
-     ### obstruction is only possible with per-dir wc.db databases.  */
-  svn_boolean_t obstructed_file;
-
-  /* The absolute path to this working copy directory. */
-  const char *local_abspath;
-
-  /* What wcroot does this directory belong to?  */
-  svn_wc__db_wcroot_t *wcroot;
-
-  /* The parent directory's per-dir information. */
-  struct svn_wc__db_pdh_t *parent;
-
-  /* Whether this process owns a write-lock on this directory. */
-  svn_boolean_t locked;
-
-  /* Hold onto the old-style access baton that corresponds to this PDH.  */
-  svn_wc_adm_access_t *adm_access;
-} svn_wc__db_pdh_t;
-
 /* Assert that the given PDH is usable.
    NOTE: the expression is multiply-evaluated!!  */
 #define VERIFY_USABLE_PDH(pdh) SVN_ERR_ASSERT(  \

Added: subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h?rev=938483&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h (added)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h Tue Apr 27 14:51:33 2010
@@ -0,0 +1,109 @@
+/**
+ * @copyright
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ * @endcopyright
+ */
+
+/* This file is not for general consumption; it should only be used by
+   wc_db.c. */
+#ifndef SVN_WC__I_AM_WC_DB
+#error "You should not be using these data structures directly"
+#endif /* SVN_WC__I_AM_WC_DB */
+
+#ifndef WC_DB_PDH_H
+#define WC_DB_PDH_H
+
+
+
+struct svn_wc__db_t {
+  /* What's the appropriate mode for this datastore? */
+  svn_wc__db_openmode_t mode;
+
+  /* We need the config whenever we run into a new WC directory, in order
+     to figure out where we should look for the corresponding datastore. */
+  svn_config_t *config;
+
+  /* Should we attempt to automatically upgrade the database when it is
+     opened, and found to be not-current?  */
+  svn_boolean_t auto_upgrade;
+
+  /* Should we ensure the WORK_QUEUE is empty when a WCROOT is opened?  */
+  svn_boolean_t enforce_empty_wq;
+
+  /* Map a given working copy directory to its relevant data.
+     const char *local_abspath -> svn_wc__db_pdh_t *pdh  */
+  apr_hash_t *dir_data;
+
+  /* As we grow the state of this DB, allocate that state here. */
+  apr_pool_t *state_pool;
+};
+
+/** Hold information about a WCROOT.
+ *
+ * This structure is referenced by all per-directory handles underneath it.
+ */
+typedef struct {
+  /* Location of this wcroot in the filesystem.  */
+  const char *abspath;
+
+  /* The SQLite database containing the metadata for everything in
+     this wcroot.  */
+  svn_sqlite__db_t *sdb;
+
+  /* The WCROOT.id for this directory (and all its children).  */
+  apr_int64_t wc_id;
+
+  /* The format of this wcroot's metadata storage (see wc.h). If the
+     format has not (yet) been determined, this will be UNKNOWN_FORMAT.  */
+  int format;
+
+} svn_wc__db_wcroot_t;
+
+/**  Pristine Directory Handle
+ *
+ * This structure records all the information that we need to deal with
+ * a given working copy directory.
+ */
+typedef struct svn_wc__db_pdh_t {
+  /* This (versioned) working copy directory is obstructing what *should*
+     be a file in the parent directory (according to its metadata).
+
+     Note: this PDH should probably be ignored (or not created).
+
+     ### obstruction is only possible with per-dir wc.db databases.  */
+  svn_boolean_t obstructed_file;
+
+  /* The absolute path to this working copy directory. */
+  const char *local_abspath;
+
+  /* What wcroot does this directory belong to?  */
+  svn_wc__db_wcroot_t *wcroot;
+
+  /* The parent directory's per-dir information. */
+  struct svn_wc__db_pdh_t *parent;
+
+  /* Whether this process owns a write-lock on this directory. */
+  svn_boolean_t locked;
+
+  /* Hold onto the old-style access baton that corresponds to this PDH.  */
+  svn_wc_adm_access_t *adm_access;
+} svn_wc__db_pdh_t;
+
+#endif /* WC_DB_PDH_H */

Propchange: subversion/trunk/subversion/libsvn_wc/wc_db_pdh.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message