From mhenoch at common-lisp.net Thu Feb 8 02:31:49 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Wed, 7 Feb 2007 21:31:49 -0500 (EST) Subject: [Cl-darcs-cvs] r85 - cl-darcs/trunk Message-ID: <20070208023149.0562F60187@common-lisp.net> Author: mhenoch Date: Wed Feb 7 21:31:49 2007 New Revision: 85 Modified: cl-darcs/trunk/pull.lisp Log: Add missing format argument. Modified: cl-darcs/trunk/pull.lisp ============================================================================== --- cl-darcs/trunk/pull.lisp (original) +++ cl-darcs/trunk/pull.lisp Wed Feb 7 21:31:49 2007 @@ -75,6 +75,6 @@ (setf applying-to-source nil)))) (format t ".")) (when source-and-pristine-differ - (format t "~&~"))))) + (format t "~&~" nil))))) (format t "~&All done"))) From mhenoch at common-lisp.net Thu Feb 8 02:34:17 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Wed, 7 Feb 2007 21:34:17 -0500 (EST) Subject: [Cl-darcs-cvs] r86 - cl-darcs/trunk Message-ID: <20070208023417.36C9E60031@common-lisp.net> Author: mhenoch Date: Wed Feb 7 21:34:16 2007 New Revision: 86 Modified: cl-darcs/trunk/patch-core.lisp Log: Unquote type declarations. Modified: cl-darcs/trunk/patch-core.lisp ============================================================================== --- cl-darcs/trunk/patch-core.lisp (original) +++ cl-darcs/trunk/patch-core.lisp Wed Feb 7 21:34:16 2007 @@ -65,17 +65,17 @@ (defclass binary-patch (file-patch) ((oldhex :accessor binary-oldhex :initarg :oldhex - :type '(vector (unsigned-byte 8)) + :type (vector (unsigned-byte 8)) :documentation "The old contents of the file.") (newhex :accessor binary-newhex :initarg :newhex - :type '(vector (unsigned-byte 8)) + :type (vector (unsigned-byte 8)) :documentation "The new contents of the file.")) (:documentation "A patch that changes a binary file.")) (defclass token-replace-patch (file-patch) - ((regexp :accessor token-regexp :initarg :regexp :type 'string) - (old-token :accessor old-token :initarg :old-token :type 'string) - (new-token :accessor new-token :initarg :new-token :type 'string)) + ((regexp :accessor token-regexp :initarg :regexp :type string) + (old-token :accessor old-token :initarg :old-token :type string) + (new-token :accessor new-token :initarg :new-token :type string)) (:documentation "A patch that replaces one token with another.")) (defmethod print-object ((patch token-replace-patch) stream) From mhenoch at common-lisp.net Fri Feb 9 18:30:27 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Fri, 9 Feb 2007 13:30:27 -0500 (EST) Subject: [Cl-darcs-cvs] r87 - cl-darcs/trunk Message-ID: <20070209183027.5E0263E008@common-lisp.net> Author: mhenoch Date: Fri Feb 9 13:30:27 2007 New Revision: 87 Modified: cl-darcs/trunk/util.lisp Log: Implement compress-file for SBCL Modified: cl-darcs/trunk/util.lisp ============================================================================== --- cl-darcs/trunk/util.lisp (original) +++ cl-darcs/trunk/util.lisp Fri Feb 9 13:30:27 2007 @@ -150,6 +150,11 @@ (ext:run-program "gzip" :input (namestring infile) :output (namestring outfile) :if-output-exists :error) (dformat "done")) + #+sbcl + ((pathnamep infile) + (dformat "~&Compressing ~A through external program..." outfile) + (sb-ext:run-program "/usr/bin/gzip" nil :input infile :output outfile + :if-output-exists :error)) (t (cerror "Assume compression performed." "Don't know how to gzip ~A to ~A." infile outfile)))) From mhenoch at common-lisp.net Thu Feb 15 04:00:30 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Wed, 14 Feb 2007 23:00:30 -0500 (EST) Subject: [Cl-darcs-cvs] r88 - cl-darcs/trunk Message-ID: <20070215040030.839D84C012@common-lisp.net> Author: mhenoch Date: Wed Feb 14 23:00:30 2007 New Revision: 88 Modified: cl-darcs/trunk/util.lisp Log: Combine regexps into one to reduce memory use. Modified: cl-darcs/trunk/util.lisp ============================================================================== --- cl-darcs/trunk/util.lisp (original) +++ cl-darcs/trunk/util.lisp Wed Feb 14 23:00:30 2007 @@ -287,13 +287,23 @@ (defun matches-one-of (regexps string) "Return true if some of REGEXPS match STRING. Cache scanners for faster execution beyond first time." - (dolist (regexp regexps) - (let ((scanner (or - (gethash regexp *scanner-cache*) - (setf (gethash regexp *scanner-cache*) - (cl-ppcre:create-scanner regexp))))) - (when (cl-ppcre:scan scanner string) - (return t))))) + ;; These scanners use _a lot_ of memory, so we build just one, and + ;; hope that the exact combination of regexps will be used often + ;; enough. + (setq regexps (sort (copy-seq regexps) #'string>)) + (let* ((combined-regexp + (apply + #'concatenate 'string + (loop for regexp in regexps + for n upfrom 0 + unless (zerop n) collect "|" + collect regexp))) + (scanner (or + (gethash combined-regexp *scanner-cache*) + (setf (gethash combined-regexp *scanner-cache*) + (cl-ppcre:create-scanner combined-regexp))))) + (when (cl-ppcre:scan scanner string) + t))) (defun file-binary-p (repo filename) "Return true if FILENAME names a binary file. From mhenoch at common-lisp.net Thu Feb 15 04:00:51 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Wed, 14 Feb 2007 23:00:51 -0500 (EST) Subject: [Cl-darcs-cvs] r89 - cl-darcs/trunk Message-ID: <20070215040051.E62DD4C012@common-lisp.net> Author: mhenoch Date: Wed Feb 14 23:00:51 2007 New Revision: 89 Modified: cl-darcs/trunk/commute.lisp Log: More commute methods Modified: cl-darcs/trunk/commute.lisp ============================================================================== --- cl-darcs/trunk/commute.lisp (original) +++ cl-darcs/trunk/commute.lisp Wed Feb 14 23:00:51 2007 @@ -27,6 +27,68 @@ (warn "No method defined for commuting ~A and ~A." p2 p1) nil) +(defmethod commute ((p2 named-patch) (p1 patch)) + "Commute a named patch and another patch." + (destructuring-bind (&optional p1-new p2-new) + (commute (named-patch-patch p2) p1) + (if p1-new + (list p1-new + (make-instance 'named-patch + :patchinfo (named-patch-patchinfo p2) + :dependencies (named-patch-dependencies p2) + :patch p2-new)) + (call-next-method)))) + +(defmethod commute ((p2 patch) (p1 named-patch)) + "Commute a patch with a named patch." + (destructuring-bind (&optional p1-new p2-new) + (commute p2 (named-patch-patch p1)) + (if p1-new + (list (make-instance 'named-patch + :patchinfo (named-patch-patchinfo p1) + :dependencies (named-patch-dependencies p1) + :patch p1-new) + p2-new) + (call-next-method)))) + +(defmethod commute ((p2 move-patch) (p1 file-patch)) + "Commute a move patch with a file patch." + (let ((patched-file (patch-filename p1)) + (moved-from (patch-move-from p2)) + (moved-to (patch-move-to p2))) + (cond + ;; File was patched and then moved + ((equal patched-file moved-from) + (let ((p1-new (copy-patch p1))) + (setf (patch-filename p1-new) moved-to) + (list p1-new p2))) + ;; Another file moved on top of original file + ((equal patched-file moved-to) + (warn "Collision when commuting ~A and ~A." p2 p1) + nil) + ;; Patches touch different files + (t + (list p1 p2))))) + +(defmethod commute ((p2 file-patch) (p1 move-patch)) + "Commute a file patch with a move patch." + (let ((moved-from (patch-move-from p1)) + (moved-to (patch-move-to p1)) + (patched-file (patch-filename p2))) + (cond + ;; File was moved and then patched + ((equal moved-to patched-file) + (let ((p2-new (copy-patch p2))) + (setf (patch-filename p2-new) moved-from) + (list p1 p2-new))) + ;; File was moved before being patched + ((equal moved-from patched-file) + (warn "Collision when commuting ~A and ~A." p2 p1) + nil) + ;; Patches touch different files + (t + (list p1 p2))))) + (defmethod commute :around ((p2 file-patch) (p1 file-patch)) "If P1 and P2 change different files, commutation is trivial." (let ((p1-file (patch-filename p1)) From mhenoch at common-lisp.net Fri Feb 16 01:04:53 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 20:04:53 -0500 (EST) Subject: [Cl-darcs-cvs] r90 - cl-darcs/trunk Message-ID: <20070216010453.955E91B010@common-lisp.net> Author: mhenoch Date: Thu Feb 15 20:04:53 2007 New Revision: 90 Modified: cl-darcs/trunk/diff.lisp cl-darcs/trunk/util.lisp Log: Ignore boring files when diffing. Enable debug output from diff. Add diff-repo-display. Modified: cl-darcs/trunk/diff.lisp ============================================================================== --- cl-darcs/trunk/diff.lisp (original) +++ cl-darcs/trunk/diff.lisp Thu Feb 15 20:04:53 2007 @@ -159,23 +159,28 @@ (merge-pathnames file repo)) (pathname-string (pathname-to-string file))) - (cond - ((fad:directory-pathname-p file) - (unless (file-boring-p repo pathname-string) - ;; We have a non-boring subdirectory. + (unless (file-boring-p repo pathname-string) + (cond + ((fad:directory-pathname-p file) (setf patches (nconc patches - (diff-repo repo original-pathname modified-pathname))))) + (diff-repo repo original-pathname modified-pathname)))) - ((file-binary-p repo pathname-string) - (setf patches (nconc patches - (diff-binary-file original-pathname - modified-pathname - :filename pathname-string)))) + ((file-binary-p repo pathname-string) + (setf patches (nconc patches + (diff-binary-file original-pathname + modified-pathname + :filename pathname-string)))) - (t - (setf patches (nconc patches - (diff-file original-pathname - modified-pathname - :filename pathname-string))))))) + (t + (setf patches (nconc patches + (diff-file original-pathname + modified-pathname + :filename pathname-string)))))))) patches)))) + +(defun diff-repo-display (repo) + "Find changes in REPO and print them to *STANDARD-OUTPUT*." + (dolist (patch (diff-repo repo)) + (display-patch patch *standard-output*))) + Modified: cl-darcs/trunk/util.lisp ============================================================================== --- cl-darcs/trunk/util.lisp (original) +++ cl-darcs/trunk/util.lisp Thu Feb 15 20:04:53 2007 @@ -17,7 +17,7 @@ (in-package :darcs) (eval-when (:compile-toplevel :load-toplevel :execute) - (defparameter +debugged-modules+ '(get #|read-patch patchinfo|# apply-patch #|init upath|# util) + (defparameter +debugged-modules+ '(get #|read-patch patchinfo|# apply-patch #|init upath|# util diff) "Modules emitting debug output.")) (defvar *http-proxy* nil From mhenoch at common-lisp.net Fri Feb 16 01:22:57 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 20:22:57 -0500 (EST) Subject: [Cl-darcs-cvs] r91 - cl-darcs/trunk Message-ID: <20070216012257.A95E52B11E@common-lisp.net> Author: mhenoch Date: Thu Feb 15 20:22:57 2007 New Revision: 91 Modified: cl-darcs/trunk/diff.lisp Log: Use enough-namestring instead of translate-pathname (fixes diff on SBCL) Modified: cl-darcs/trunk/diff.lisp ============================================================================== --- cl-darcs/trunk/diff.lisp (original) +++ cl-darcs/trunk/diff.lisp Thu Feb 15 20:22:57 2007 @@ -138,9 +138,9 @@ ;; With fad:list-directory, we get absolute pathnames. We make ;; them relative to the "root", so they can be compared. (flet ((original-to-repo-relative (p) - (translate-pathname p pristine-wild wild)) + (pathname (enough-namestring p pristine))) (modified-to-repo-relative (p) - (translate-pathname p repo-wild wild))) + (pathname (enough-namestring p repo)))) ;; We list the files in the current directory, both in the ;; original and the modified tree, and get the union. (let* ((files-in-original From mhenoch at common-lisp.net Fri Feb 16 01:24:00 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 20:24:00 -0500 (EST) Subject: [Cl-darcs-cvs] r92 - cl-darcs/trunk Message-ID: <20070216012400.6C8692B11E@common-lisp.net> Author: mhenoch Date: Thu Feb 15 20:24:00 2007 New Revision: 92 Modified: cl-darcs/trunk/packages.lisp Log: Export diff-repo-display Modified: cl-darcs/trunk/packages.lisp ============================================================================== --- cl-darcs/trunk/packages.lisp (original) +++ cl-darcs/trunk/packages.lisp Thu Feb 15 20:24:00 2007 @@ -4,5 +4,6 @@ (:use :cl) (:nicknames :cl-darcs) (:export - #:get-repo #:pull #:diff-repo #:*http-proxy* + #:*http-proxy* + #:get-repo #:pull #:diff-repo #:diff-repo-display #:record-changes #:create-repo)) From mhenoch at common-lisp.net Fri Feb 16 04:45:34 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 23:45:34 -0500 (EST) Subject: [Cl-darcs-cvs] r93 - cl-darcs/trunk Message-ID: <20070216044534.C5CD15538C@common-lisp.net> Author: mhenoch Date: Thu Feb 15 23:45:34 2007 New Revision: 93 Modified: cl-darcs/trunk/pull.lisp Log: Add repositories that we pull from to "repos" Modified: cl-darcs/trunk/pull.lisp ============================================================================== --- cl-darcs/trunk/pull.lisp (original) +++ cl-darcs/trunk/pull.lisp Thu Feb 15 23:45:34 2007 @@ -25,6 +25,7 @@ (setf theirrepo (car (get-preflist ourrepo "defaultrepo"))) (unless theirrepo (error "No remote repositiory specified, and no default available."))) + (add-to-preflist ourrepo "repos" theirrepo) (let ((our-patchinfo (read-repo-patch-list ourrepo)) (their-patchinfo (read-repo-patch-list theirrepo))) (multiple-value-bind (common only-ours only-theirs) From mhenoch at common-lisp.net Fri Feb 16 04:49:19 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 23:49:19 -0500 (EST) Subject: [Cl-darcs-cvs] r94 - cl-darcs/trunk Message-ID: <20070216044919.53CB45538E@common-lisp.net> Author: mhenoch Date: Thu Feb 15 23:49:19 2007 New Revision: 94 Modified: cl-darcs/trunk/get.lisp cl-darcs/trunk/pull.lisp Log: Print MOTD when getting and pulling Modified: cl-darcs/trunk/get.lisp ============================================================================== --- cl-darcs/trunk/get.lisp (original) +++ cl-darcs/trunk/get.lisp Thu Feb 15 23:49:19 2007 @@ -35,6 +35,10 @@ ;; We should probably download checkpoint patches, btw... (checkpoint (when partial (car (last (read-checkpoint-list repodir)))))) + (let ((motd (get-preflist repodir "motd"))) + (when motd + (format t "~{~&~A~}" motd))) + ;; Create directories... (prepare-new-repo outname) (set-default-repo outname inrepodir) Modified: cl-darcs/trunk/pull.lisp ============================================================================== --- cl-darcs/trunk/pull.lisp (original) +++ cl-darcs/trunk/pull.lisp Thu Feb 15 23:49:19 2007 @@ -26,6 +26,9 @@ (unless theirrepo (error "No remote repositiory specified, and no default available."))) (add-to-preflist ourrepo "repos" theirrepo) + (let ((motd (get-preflist theirrepo "motd"))) + (when motd + (format t "~{~&~A~}" motd))) (let ((our-patchinfo (read-repo-patch-list ourrepo)) (their-patchinfo (read-repo-patch-list theirrepo))) (multiple-value-bind (common only-ours only-theirs) From mhenoch at common-lisp.net Fri Feb 16 04:59:51 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 15 Feb 2007 23:59:51 -0500 (EST) Subject: [Cl-darcs-cvs] r95 - cl-darcs/trunk/doc Message-ID: <20070216045951.1270659081@common-lisp.net> Author: mhenoch Date: Thu Feb 15 23:59:50 2007 New Revision: 95 Added: cl-darcs/trunk/doc/ cl-darcs/trunk/doc/cl-darcs.texi Log: Start writing documentation Added: cl-darcs/trunk/doc/cl-darcs.texi ============================================================================== --- (empty file) +++ cl-darcs/trunk/doc/cl-darcs.texi Thu Feb 15 23:59:50 2007 @@ -0,0 +1,265 @@ +\input texinfo + at setfilename cl-darcs.info + at settitle cl-darcs 0.2.0 manual + + at copying +This is the manual for cl-darcs, version 0.2.0. + +Copyright @copyright{} 2007 Magnus Henoch + + at quotation +Permission is granted to make and distribute verbatim copies or +modified versions of this manual, provided the copyright notice and +this permission notice are preserved on all copies. + at end quotation + at end copying + + at titlepage + at title cl-darcs 0.2.0 + at subtitle a darcs client in Common Lisp + at author Magnus Henoch + + at page + at vskip 0pt plus 1filll + at insertcopying + at end titlepage + + at contents + + at ifnottex + at node Top, Introduction, (dir), (dir) + at top cl-darcs manual + + at insertcopying + + at end ifnottex + + + at menu +* Introduction:: +* Access methods:: +* Getting a repository:: +* Creating a new repository:: +* Pulling new patches:: +* Recording a patch:: +* Working directory layout:: + at end menu + + at node Introduction, Access methods, Top, Top + at chapter Introduction + +cl-darcs is an implementation of the darcs version control system +written in Common Lisp. + +Darcs was originally developed by David Roundy. Its distinguishing +features among other version control systems are that it is +distributed and based on a system of patch algebra. The distributedness +means that unlike CVS and SVN, every checked-out copy of a tree is a +branch or an archive in its full right, where patches can be recorded +and shared. This makes new models of distributed development easy. The +patch algebra means that the program can in many cases be smart about +how patches interact with eachother. You can pull patches from one +archive to another, perhaps in different order or leaving some patches +behind, and the program will try to figure out how those patches would +look in this new context. See @uref{http://www.darcs.net}, the official +web page. + +The original darcs implementation is written in Haskell, and requires +extensions present only in GHC, the Glasgow Haskell Compiler. However, +GHC is not available for all platforms, and can be different to port as +it requires itself as compiler. Therefore I started to write cl-darcs +in (mostly) portable Common Lisp, to be able to use darcs on my +favourite system. at footnote{That is, NetBSD/powerpc. CLISP runs well +there, and recently SBCL has been ported as well.} + +cl-darcs is still in an early stage of development, so expect to find +bugs and unhandled corner cases (or, just as likely, unhandled +middle-of-the-room cases). However, it is already useful for simple +usage. + + at node Access methods, Getting a repository, Introduction, Top + at chapter Access methods + +cl-darcs can access repositories on a local disk (read and write) and on +an HTTP server (read-only). Unlike the original darcs client, it +doesn't yet support access through SSH; you can emulate that with + at command{scp} or @command{rsync}. + +When passing a path of a local repository to cl-darcs, it should usually +be a directory pathname, not a file pathname. That is, add a trailing +slash, as in @samp{"/path/to/repo/"}, not @samp{"/path/to/repo"}. Most +functions can handle both forms (using + at code{CL-FAD:PATHNAME-AS-DIRECTORY}), though. + + at defopt DARCS:*HTTP-PROXY* +If you want to use a proxy for HTTP access, set this variable to +e.g. @samp{"proxy.example.com:3128"}. When NIL, no proxy is used. + +Using a caching proxy (e.g. Squid) can be a good idea, since cl-darcs is +sometimes a bit wasteful about how much it downloads, and bugs might +make it lose what it already has downloaded. + at end defopt + + at node Getting a repository, Creating a new repository, Access methods, Top + at chapter Getting a repository + + at defun DARCS:GET-REPO in-path out-path &key query +Get a local copy of the tree at @var{in-path}, and write it to + at var{out-path}. @var{in-path} may be an HTTP URL or a local directory. + at var{out-path} must be a local nonexistent directory. + +If @var{query} is true, ask for a range of patches to download and +apply. + at end defun + +Getting a copy of a repository involves getting all the patches from +that repository, and applying them one by one to the local tree. This +can be a lot of data, if the repository has long history. Darcs has a +concept of ``checkpoints'', which cl-darcs doesn't yet support. + +The location of the repository is saved (in + at file{_darcs/prefs/defaultrepo}), and is used as default repository to +pull from. @xref{Pulling new patches}. + + at node Creating a new repository, Pulling new patches, Getting a repository, Top + at chapter Creating a new repository + + at defun DARCS:CREATE-REPO repodir +Create a new empty repository in @var{repodir}. @var{repodir} must be +a local nonexistent directory. + at end defun + +After creating a repository, create or copy the files it should contain, +and record a patch; see @ref{Recording a patch}. You may want to make +this directory accessible to others through HTTP, SSH or other +protocols; how to do that is outside the scope of this manual. + + at node Pulling new patches, Recording a patch, Creating a new repository, Top + at chapter Pulling new patches + +Updating your working copy with new patches from the original repository +is called ``pulling'' these patches. + + at defun DARCS:PULL our-repo &optional their-repo +Pull new patches from @var{their-repo} into @var{our-repo}. + at var{our-repo} must be a local darcs tree. @var{their-repo} can be a +local directory or an HTTP URL. + +If @var{their-repo} is not specified, use the default repository +specified in preferences, as set when getting the initial copy. + at end defun + +Currently @code{DARCS:PULL} doesn't handle unrecorded local changes +well. It is recommended that you record your changes or revert them +before pulling. If you don't, and your changes conflict with the newly +pulled patches, you will be presented with the option of applying +patches only to the pristine tree (@pxref{Working directory layout}), +from where you can recover the changed file and merge it with your +changes. + +Also, all new patches will be pulled without asking. This is +suboptimal; selecting some of the patches should be supported. + + at node Recording a patch, Working directory layout, Pulling new patches, Top + at chapter Recording a patch + +What is called ``committing'' in some other version control systems, is +called ``recording'' in darcs. Before doing that, you may want to +review your local changes. + + at defun DARCS:DIFF-REPO-DISPLAY repo +Find changes in @var{repo} and print them. + at end defun + +This command compares the files in your working directory to the +pristine tree; see @ref{Working directory layout}. ``Boring'' files are +ignored; see @ref{Boring files}. New files in your tree are +automatically included in the diff output, unless they are ``boring''. + + at defun DARCS:RECORD-CHANGES repo name author date log +Interactively ask which changes to @var{repo} to record. + + at var{repo} is the local directory containing the repository. @var{name} +is the ``name'' of the patch, usually a one-line summary of the change. + at var{author} is an author identifier, usually an e-mail address. + at var{date} is usually the keyword @samp{:NOW}, but can also be a string +in @samp{YYYYMMDDHHMMSS} format. @var{log} is a string (possibly +multi-line) containing a longer description of the patch, or @samp{NIL}. + + at end defun + +Unlike many other version control systems, you can commit just some of +the changes in a file, by answering yes to some hunks and no to others. + + at menu +* Boring files:: +* Binary files:: + at end menu + + at node Boring files, Binary files, Recording a patch, Recording a patch + at section Boring files + +There are many files that you usually don't want to have under version +control. That includes editor backups and compiled or otherwise +autogenerated files. @code{DARCS:RECORD-CHANGES} will not record a file +unless you tell it to, but on the other hand it will ask about all files +that are not yet recorded, which can be annoying. + +Thus you can define files and directories matching certain regexps as +``boring'', not to be included in patches. The file + at file{_darcs/prefs/boring} contains such regexps, one per line. Lines +starting with @samp{#} are ignored. + +The original darcs client supports choosing another file as the list of +boring regexps, and keeping this file under version control in the +tree. cl-darcs doesn't yet support that. + + at node Binary files, , Boring files, Recording a patch + at section Binary files + +The default diff format used by darcs makes sense for text files, but +usually not for binary files. Therefore, patches to binary files +simply consist of the content before the change, and the content after +the change. + +Which files are treated as binary is specified in the file + at file{_darcs/prefs/binaries}. Each line, except those starting with + at samp{#}, is treated as a regexp matching binary files. + +The original darcs client supports choosing another file as the list of +binary regexps, and keeping this file under version control in the +tree. cl-darcs doesn't yet support that. + + at node Working directory layout, , Recording a patch, Top + at chapter Working directory layout + +A darcs working tree (or a repository; the difference is only in your +mind) keeps some special files in the directory @file{_darcs} in the top +level, and nowhere else. + +This directory contains a directory called + at file{pristine}. at footnote{Older versions of the original darcs client +call it @file{current} instead.} In this directory, an unchanged copy +of your files is stored. This is used to find what has been changed +from what has been recorded. + +There is also an @file{inventory} file, which lists all patches that +have been applied, in the correct order. The actual patches are stored +in the @file{patches} directory. The @file{inventories} directory +contains older inventory files, which describe the history before +certain ``tags'' in the tree. cl-darcs can read repositories with tags, +but can't yet create them. + +The directory @file{checkpoints} contains checkpoints that have been +made to eliminate the need of getting every patch since the tree was +created. cl-darcs can neither use nor create such checkpoints, though. + +The @file{prefs} directory contains files that the user is free to +edit. The files @file{boring} and @file{binaries} were described above; +see @ref{Boring files}, and @ref{Binary files}. The file + at file{defaultrepo} contains the default repository to pull from, and + at file{repos} contains repositories you have pulled from at some time. + at file{motd} contains the ``message of the day'', which is printed when +you get or pull from this repository. + + at bye From mhenoch at common-lisp.net Mon Feb 19 21:39:30 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Mon, 19 Feb 2007 16:39:30 -0500 (EST) Subject: [Cl-darcs-cvs] r96 - cl-darcs/trunk Message-ID: <20070219213930.84474586A9@common-lisp.net> Author: mhenoch Date: Mon Feb 19 16:39:30 2007 New Revision: 96 Modified: cl-darcs/trunk/pull.lisp Log: Allow selecting which patches to pull Modified: cl-darcs/trunk/pull.lisp ============================================================================== --- cl-darcs/trunk/pull.lisp (original) +++ cl-darcs/trunk/pull.lisp Mon Feb 19 16:39:30 2007 @@ -37,12 +37,14 @@ (format t "~&Found these new patches:") (dolist (p only-theirs) (format t "~& - ~A" p)) - ;; XXX: This is where we pick which of their patches we want to - ;; pull. - (let* ((their-patches + (let* ((all-their-patches (mapcar (lambda (patchinfo) (read-patch-from-repo theirrepo patchinfo)) only-theirs)) + (their-patches + (if (y-or-n-p "Pull all patches?") + all-their-patches + (select-patches all-their-patches))) (our-patches (mapcar (lambda (patchinfo) (read-patch-from-repo ourrepo patchinfo)) From mhenoch at common-lisp.net Mon Feb 19 22:06:39 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Mon, 19 Feb 2007 17:06:39 -0500 (EST) Subject: [Cl-darcs-cvs] r97 - cl-darcs/trunk Message-ID: <20070219220639.72AC22F054@common-lisp.net> Author: mhenoch Date: Mon Feb 19 17:06:39 2007 New Revision: 97 Modified: cl-darcs/trunk/commute.lisp Log: Fix misplaced parenthesis in COMMUTE for two hunk-patches Modified: cl-darcs/trunk/commute.lisp ============================================================================== --- cl-darcs/trunk/commute.lisp (original) +++ cl-darcs/trunk/commute.lisp Mon Feb 19 17:06:39 2007 @@ -113,7 +113,7 @@ (make-instance 'hunk-patch :filename (patch-filename p2) :line-number (+ line2 (- (length new1)) (length old1)) :old old2 :new new2))) - ((< (+ line2 (length old2) line1)) + ((< (+ line2 (length old2)) line1) ;; The second patch changes text before the first patch. (list (make-instance 'hunk-patch :filename (patch-filename p1) :line-number (+ line1 (length new2) (- (length old2))) From mhenoch at common-lisp.net Sat Feb 24 23:50:52 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Sat, 24 Feb 2007 18:50:52 -0500 (EST) Subject: [Cl-darcs-cvs] r98 - cl-darcs/trunk Message-ID: <20070224235052.9DFA72F05B@common-lisp.net> Author: mhenoch Date: Sat Feb 24 18:50:52 2007 New Revision: 98 Modified: cl-darcs/trunk/apply-patch.lisp Log: Fix APPLY-PATCH for TOKEN-REPLACE-PATCH Modified: cl-darcs/trunk/apply-patch.lisp ============================================================================== --- cl-darcs/trunk/apply-patch.lisp (original) +++ cl-darcs/trunk/apply-patch.lisp Sat Feb 24 18:50:52 2007 @@ -186,27 +186,27 @@ (token-regexp patch)))) (replacement (format nil "\\1~A\\2" (new-token patch)))) (dformat "~&Patching ~A with ~A." filename patch) - (with-file-patching (in out filename) (apply-patch patch repodir) + (with-file-patching (in out filename) (let ((file-empty t)) (flet ((maybe-terpri () ;; Unless we're writing the first line, we have to ;; terminate the previous one. (if file-empty (setf file-empty nil) - (terpri out)))) + (write-byte 10 out)))) (loop - (multiple-value-bind (line delim) (read-until #\Newline in nil :eof) - (setf line (coerce line 'string)) - (when (cl-ppcre:scan new-regexp line) - (cerror "Ignore" "While replacing ~S with ~S, found ~S before patching: ~S." - (old-token patch) (new-token patch) (new-token patch) line)) - - (maybe-terpri) - (when (eql delim :eof) - (return)) - - (let ((patched-line (cl-ppcre:regex-replace-all old-regexp line replacement))) - (write-string patched-line out))))))))) + (let ((line (read-binary-line in nil :eof))) + (when (eql line :eof) + (return)) + (maybe-terpri) + + (setf line (bytes-to-string line)) + (when (cl-ppcre:scan new-regexp line) + (cerror "Ignore" "While replacing ~S with ~S, found ~S before patching: ~S." + (old-token patch) (new-token patch) (new-token patch) line)) + + (let ((patched-line (cl-ppcre:regex-replace-all old-regexp line replacement))) + (write-sequence (string-to-bytes patched-line) out))))))))) (defmethod apply-patch ((patch hunk-patch) repodir) "Apply a single hunk patch to REPODIR." From mhenoch at common-lisp.net Tue Feb 27 02:55:18 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Mon, 26 Feb 2007 21:55:18 -0500 (EST) Subject: [Cl-darcs-cvs] r99 - cl-darcs/trunk Message-ID: <20070227025518.ABDE360034@common-lisp.net> Author: mhenoch Date: Mon Feb 26 21:55:18 2007 New Revision: 99 Modified: cl-darcs/trunk/README Log: Update README Modified: cl-darcs/trunk/README ============================================================================== --- cl-darcs/trunk/README (original) +++ cl-darcs/trunk/README Mon Feb 26 21:55:18 2007 @@ -6,52 +6,25 @@ * Usage -At the REPL: - -(asdf:oos 'asdf:load-op :cl-darcs) -(darcs:get-repo "http://path/to/repo" "/local/non-existent/directory/") - -Or if you want to select which patches to apply: - -(darcs:get-repo "http://path/to/repo" "/local/repo-dir/" :query t) - -To pull new patches from a repo (the address from the remote repo is -optional, as it defaults to where you got the tree from): - -(darcs:pull "/local/repo-dir/") -or -(darcs:pull "/local/repo-dir/" "http://path/to/repo") - -When pulling, the new patches will be applied on top of any unrecorded -changes, which has a good chance of not working. - -To record your own changes: - -(darcs:record-changes "/local/repo-dir/" - "Short patch description" - "my-address at example.com" - :now - "Longer, possibly multi-line, description. -Or just NIL.") - -You will be asked about which changes should be recorded. - -* Configuration - -cl-darcs can use an HTTP proxy: - -(setf darcs:*http-proxy* "proxy.example.com:3128") +See the manual in the doc directory. * Known bugs and misfeatures -Above all, cl-darcs is currently a read-only client. There is no -support for generating diffs or committing patches. +cl-darcs is brittle and might eat your data. Getting a remote +repository or pulling patches from it will not affect it; what happens +with the target repository varies slighly. Make backups of data you +care about, and report bugs! + +cl-darcs seems to cope well with either just pulling patches from a +remote source, or just recording patches, but the combination of these +two activities hasn't been extensively tested. Some combinations of merger patches are not properly handled. You should be able to get a tree with a real darcs client, and then use cl-darcs for pulling new patches. -Repositories can be fetched only from local files and HTTP. +Repositories can be fetched only from local files and HTTP. Patches +can only be applied to local repositories. Tags are not faithfully reproduced. @@ -59,9 +32,10 @@ * Compatibility -I primarily develop cl-darcs on CLISP, but try to keep it working on -SBCL as well. Users of non-Unix systems probably need to change -MAKE-TEMP-FILE-NAME in util.lisp. +cl-darcs works on CLISP and SBCL on Unix-like systems. Getting it to +work on other Lisp implementations should be simple; grep the code for +#+clisp or #+sbcl. For other operating systems, modify +MAKE-TEMP-FILE-NAME in util.lisp accordingly. * Dependencies From mhenoch at common-lisp.net Tue Feb 27 02:56:43 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Mon, 26 Feb 2007 21:56:43 -0500 (EST) Subject: [Cl-darcs-cvs] r100 - cl-darcs/trunk Message-ID: <20070227025643.E4AC36003D@common-lisp.net> Author: mhenoch Date: Mon Feb 26 21:56:42 2007 New Revision: 100 Modified: cl-darcs/trunk/cl-darcs.asd Log: Update version in ASDF file Modified: cl-darcs/trunk/cl-darcs.asd ============================================================================== --- cl-darcs/trunk/cl-darcs.asd (original) +++ cl-darcs/trunk/cl-darcs.asd Mon Feb 26 21:56:42 2007 @@ -7,7 +7,7 @@ (defsystem cl-darcs :description "Darcs client" - :version "0.0.1" + :version "0.2.0" :licence "GPL" :author "Magnus Henoch " :depends-on (:split-sequence From mhenoch at common-lisp.net Tue Feb 27 02:58:39 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Mon, 26 Feb 2007 21:58:39 -0500 (EST) Subject: [Cl-darcs-cvs] r101 - in cl-darcs/tags/0.2.0: . doc Message-ID: <20070227025839.0D3A56003D@common-lisp.net> Author: mhenoch Date: Mon Feb 26 21:58:38 2007 New Revision: 101 Added: cl-darcs/tags/0.2.0/ - copied from r53, cl-darcs/trunk/ cl-darcs/tags/0.2.0/README - copied unchanged from r99, cl-darcs/trunk/README cl-darcs/tags/0.2.0/apply-patch.lisp - copied unchanged from r98, cl-darcs/trunk/apply-patch.lisp cl-darcs/tags/0.2.0/cl-darcs.asd - copied unchanged from r100, cl-darcs/trunk/cl-darcs.asd cl-darcs/tags/0.2.0/commute.lisp - copied unchanged from r97, cl-darcs/trunk/commute.lisp cl-darcs/tags/0.2.0/diff.lisp - copied unchanged from r91, cl-darcs/trunk/diff.lisp cl-darcs/tags/0.2.0/display-patch.lisp - copied unchanged from r81, cl-darcs/trunk/display-patch.lisp cl-darcs/tags/0.2.0/doc/ - copied from r95, cl-darcs/trunk/doc/ cl-darcs/tags/0.2.0/get.lisp - copied unchanged from r94, cl-darcs/trunk/get.lisp cl-darcs/tags/0.2.0/packages.lisp - copied unchanged from r92, cl-darcs/trunk/packages.lisp cl-darcs/tags/0.2.0/patch-core.lisp - copied unchanged from r86, cl-darcs/trunk/patch-core.lisp cl-darcs/tags/0.2.0/prefs.lisp - copied unchanged from r60, cl-darcs/trunk/prefs.lisp cl-darcs/tags/0.2.0/pull.lisp - copied unchanged from r96, cl-darcs/trunk/pull.lisp cl-darcs/tags/0.2.0/record.lisp - copied unchanged from r82, cl-darcs/trunk/record.lisp cl-darcs/tags/0.2.0/unreadable-stream.lisp - copied unchanged from r58, cl-darcs/trunk/unreadable-stream.lisp cl-darcs/tags/0.2.0/upath.lisp - copied unchanged from r62, cl-darcs/trunk/upath.lisp cl-darcs/tags/0.2.0/util.lisp - copied unchanged from r90, cl-darcs/trunk/util.lisp cl-darcs/tags/0.2.0/write-patch.lisp - copied unchanged from r61, cl-darcs/trunk/write-patch.lisp Log: Tag 0.2.0