[Cl-darcs-cvs] r169 - cl-darcs/trunk

mhenoch at common-lisp.net mhenoch at common-lisp.net
Wed Mar 5 08:56:43 UTC 2008


Author: mhenoch
Date: Wed Mar  5 03:56:43 2008
New Revision: 169

Modified:
   cl-darcs/trunk/pull.lisp
   cl-darcs/trunk/upath.lisp
Log:
Add UPATH-TO-STRING and use it for saving repository addresses


Modified: cl-darcs/trunk/pull.lisp
==============================================================================
--- cl-darcs/trunk/pull.lisp	(original)
+++ cl-darcs/trunk/pull.lisp	Wed Mar  5 03:56:43 2008
@@ -31,7 +31,7 @@
     (setf theirrepo (car (get-preflist ourrepo "defaultrepo")))
     (unless theirrepo
       (error "No remote repository specified, and no default available.")))
-  (add-to-preflist ourrepo "repos" theirrepo)
+  (add-to-preflist ourrepo "repos" (upath-to-string theirrepo))
   (let ((motd (get-preflist theirrepo "motd")))
     (when motd
       (format t "~{~&~A~}" motd)))

Modified: cl-darcs/trunk/upath.lisp
==============================================================================
--- cl-darcs/trunk/upath.lisp	(original)
+++ cl-darcs/trunk/upath.lisp	Wed Mar  5 03:56:43 2008
@@ -80,3 +80,15 @@
     (pathname
      (open upath :direction :input :if-does-not-exist :error
 	   :element-type (if binary '(unsigned-byte 8) 'character)))))
+
+(defun upath-to-string (upath)
+  "Convert UPATH to a string.
+This string can be read with MAKE-UPATH."
+  (ctypecase upath
+    (string
+     upath)
+    (pathname
+     (namestring upath))
+    (net.uri:uri
+     (with-output-to-string (s)
+       (net.uri:render-uri upath s)))))



More information about the Cl-darcs-cvs mailing list