[clouchdb-cvs] CVS clouchdb/src
peddy
peddy at common-lisp.net
Tue Dec 18 18:03:46 UTC 2007
Update of /project/clouchdb/cvsroot/clouchdb/src
In directory clnet:/tmp/cvs-serv15160/src
Modified Files:
clouchdb.lisp
Log Message:
Fixed (get-db-info) for SBCL when :db-name is specified as null (get server info)
--- /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp 2007/12/18 17:26:56 1.8
+++ /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp 2007/12/18 18:03:45 1.9
@@ -38,7 +38,13 @@
(defparameter *temp-db-counter* 0 "Used in the creation of temporary databases")
-(defconstant +utf-8+ (make-external-format :utf-8 :eol-style :lf)
+(defmacro define-constant (name value &optional doc)
+ "A version of DEFCONSTANT for, cough, /strict/ CL implementations."
+ ;; See <http://www.sbcl.org/manual/Defining-Constants.html>
+ `(defconstant ,name (if (boundp ',name) (symbol-value ',name) ,value)
+ ,@(when doc (list doc))))
+
+(define-constant +utf-8+ (make-external-format :utf-8 :eol-style :lf)
"Default external format for document content.")
;;
@@ -212,6 +218,23 @@
:uri (make-uri dbn)))))
,result)))
+<<<<<<< clouchdb.lisp
+;; (defmacro handle-doc-errors (&body body)
+;; (let ((result (gensym)))
+;; `(let ((,result (progn , at body)))
+;; (when (document-property :error (,result))
+;; (cond ((equal "conflict" (document-property :error result))
+;; (error 'id-or-revision-conflict
+
+<<<<<<< clouchdb.lisp
+;;
+;;
+;;
+
+=======
+>>>>>>> 1.7
+=======
+>>>>>>> 1.8
(defun document-to-json (doc)
"Convert document data, the top-level of wich is either an
associative list or hashtable, to json data"
@@ -349,7 +372,8 @@
"Get information for named database, or couchdb server if no
database specified."
(let ((dbn (if db-name-p db-name *db-name*)))
- (db-request (cat (url-encode dbn) "/") :method :get)))
+ (db-request (if dbn (cat (url-encode dbn) "/"))
+ :method :get)))
(defun create-temp-db-name ()
"Return a database name that's probably unique."
More information about the clouchdb-cvs
mailing list