Author: philip
Date: Mon Dec 10 17:47:46 2012
New Revision: 1419605

URL: http://svn.apache.org/viewvc?rev=1419605&view=rev
Log:
Move token maps to a separate header for ease of parsing by
transform-sql.py.

* subversion/libsvn_wc/token-map.h: New.

* subversion/libsvn_wc/wc_db.c
  (kind_map, presence_map): Move to new file.

Added:
    subversion/trunk/subversion/libsvn_wc/token-map.h   (with props)
Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Added: subversion/trunk/subversion/libsvn_wc/token-map.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/token-map.h?rev=1419605&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/token-map.h (added)
+++ subversion/trunk/subversion/libsvn_wc/token-map.h Mon Dec 10 17:47:46 2012
@@ -0,0 +1,49 @@
+/**
+ * ====================================================================
+ *    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.
+ * ====================================================================
+ *
+ * This header is parsed by transform-sql.py to allow SQLite
+ * statements to refer to string values by symbolic names.
+ */
+
+#include "svn_types.h"
+#include "wc_db.h"
+#include "private/svn_token.h"
+
+static const svn_token_map_t kind_map[] = {
+  { "file", svn_kind_file },
+  { "dir", svn_kind_dir },
+  { "symlink", svn_kind_symlink },
+  { "unknown", svn_kind_unknown },
+  { NULL }
+};
+
+/* Note: we only decode presence values from the database. These are a
+   subset of all the status values. */
+static const svn_token_map_t presence_map[] = {
+  { "normal", svn_wc__db_status_normal },
+  { "server-excluded", svn_wc__db_status_server_excluded },
+  { "excluded", svn_wc__db_status_excluded },
+  { "not-present", svn_wc__db_status_not_present },
+  { "incomplete", svn_wc__db_status_incomplete },
+  { "base-deleted", svn_wc__db_status_base_deleted },
+  { NULL }
+};
+
+

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1419605&r1=1419604&r2=1419605&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Dec 10 17:47:46 2012
@@ -46,6 +46,7 @@
 #include "conflicts.h"
 #include "wc_db_private.h"
 #include "workqueue.h"
+#include "token-map.h"
 
 #include "svn_private_config.h"
 #include "private/svn_sqlite.h"
@@ -269,27 +270,6 @@ typedef struct insert_external_baton_t {
 } insert_external_baton_t;
 
 
-static const svn_token_map_t kind_map[] = {
-  { "file", svn_kind_file },
-  { "dir", svn_kind_dir },
-  { "symlink", svn_kind_symlink },
-  { "unknown", svn_kind_unknown },
-  { NULL }
-};
-
-/* Note: we only decode presence values from the database. These are a subset
-   of all the status values. */
-static const svn_token_map_t presence_map[] = {
-  { "normal", svn_wc__db_status_normal },
-  { "server-excluded", svn_wc__db_status_server_excluded },
-  { "excluded", svn_wc__db_status_excluded },
-  { "not-present", svn_wc__db_status_not_present },
-  { "incomplete", svn_wc__db_status_incomplete },
-  { "base-deleted", svn_wc__db_status_base_deleted },
-  { NULL }
-};
-
-
 /* Forward declarations  */
 static svn_error_t *
 add_work_items(svn_sqlite__db_t *sdb,


Reply via email to