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

mhenoch at common-lisp.net mhenoch at common-lisp.net
Fri Jul 14 23:47:12 UTC 2006


Author: mhenoch
Date: Fri Jul 14 19:47:12 2006
New Revision: 31

Modified:
   cl-darcs/trunk/repo.lisp
Log:
Add append-inventory function


Modified: cl-darcs/trunk/repo.lisp
==============================================================================
--- cl-darcs/trunk/repo.lisp	(original)
+++ cl-darcs/trunk/repo.lisp	Fri Jul 14 19:47:12 2006
@@ -132,6 +132,20 @@
 	     (write-byte 10 f)
 	     (print-patchinfos (car patchinfo-list)))))))))
 
+(defun append-inventory (outrepo patchinfo)
+  "Append PATCHINFO to inventory in OUTREPO."
+  (with-open-file (f (merge-pathnames 
+		      (make-pathname :directory '(:relative "_darcs")
+				     :name "inventory")
+		      outrepo)
+		     :direction :output :if-exists :append
+		     :element-type '(unsigned-byte 8))
+    (map nil (lambda (char)
+	       (write-byte (char-code char) f))
+	 (with-output-to-string (strout)
+	   (write-patchinfo patchinfo strout)))
+    (write-byte 10 f)))
+
 (defun get-common-and-uncommon (ours theirs)
   "Given patchsets OURS and THEIRS, find common and uncommon patches.
 OURS and THEIRS are lists of lists of patchinfos, as returned by



More information about the Cl-darcs-cvs mailing list