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

mhenoch at common-lisp.net mhenoch at common-lisp.net
Wed Aug 22 02:00:49 UTC 2007


Author: mhenoch
Date: Tue Aug 21 22:00:48 2007
New Revision: 120

Modified:
   cl-darcs/trunk/apply-patch.lisp
Log:
For Lispworks, use RENAME-FILE when applying a MOVE-PATCH.  Suggestion by Jochen Schmidt.
Signal an error if the Lisp implementation is unsupported.
Partial fix for #2.


Modified: cl-darcs/trunk/apply-patch.lisp
==============================================================================
--- cl-darcs/trunk/apply-patch.lisp	(original)
+++ cl-darcs/trunk/apply-patch.lisp	Tue Aug 21 22:00:48 2007
@@ -1,4 +1,4 @@
-;;; Copyright (C) 2006 Magnus Henoch
+;;; Copyright (C) 2006, 2007 Magnus Henoch
 ;;;
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU General Public License as
@@ -169,7 +169,13 @@
 			       :search t)
     #+clisp (let ((result (ext:run-program "mv" :arguments (list (namestring from) (namestring to)))))
 	      (unless (eql result 0)
-		(error "Couldn't move ~A to ~A." from to)))))
+		(error "Couldn't move ~A to ~A." from to)))
+    
+    ;; In Lispworks, this works for both files and directories.
+    #+lispworks (rename-file from to)
+
+    #-(or clisp sbcl lispworks)
+    (error "Applying a MOVE-PATCH is not implemented for ~A." (lisp-implementation-type))))
 
 (defmethod apply-patch ((patch token-replace-patch) repodir)
   "Apply a token replace patch to a file in REPODIR."



More information about the Cl-darcs-cvs mailing list