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

mhenoch at common-lisp.net mhenoch at common-lisp.net
Fri Oct 6 19:49:46 UTC 2006


Author: mhenoch
Date: Fri Oct  6 15:49:46 2006
New Revision: 48

Modified:
   cl-darcs/trunk/write-patch.lisp
Log:
Use compress-file in write-patch-to-repo


Modified: cl-darcs/trunk/write-patch.lisp
==============================================================================
--- cl-darcs/trunk/write-patch.lisp	(original)
+++ cl-darcs/trunk/write-patch.lisp	Fri Oct  6 15:49:46 2006
@@ -17,14 +17,16 @@
 (in-package :darcs)
 
 (defun write-patch-to-repo (patch repo)
-  "Write the named patch PATCH to REPO, under correct filename."
+  "Write the named patch PATCH to REPO, compressed, under correct filename."
   (let ((filename
 	 (upath-subdir repo '("_darcs" "patches")
 		       (patchinfo-make-filename 
 			(named-patch-patchinfo patch)))))
-    (with-open-file (out filename :direction :output :element-type '(unsigned-byte 8)
-			 :if-exists :error)
-      (write-patch patch out))))
+    (with-temp-file-name tmp-file
+      (with-open-file (out tmp-file :direction :output :element-type '(unsigned-byte 8)
+			   :if-exists :error)
+	(write-patch patch out))
+      (compress-file tmp-file filename))))
 
 (defgeneric write-patch (patch stream)
   (:documentation "Write PATCH to STREAM, in darcs patch format.



More information about the Cl-darcs-cvs mailing list