From mhenoch at common-lisp.net Thu Nov 22 13:52:40 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Thu, 22 Nov 2007 08:52:40 -0500 (EST) Subject: [Cl-darcs-cvs] r147 - cl-darcs/trunk Message-ID: <20071122135240.3703E72093@common-lisp.net> Author: mhenoch Date: Thu Nov 22 08:52:39 2007 New Revision: 147 Modified: cl-darcs/trunk/diff.lisp Log: Use TRUENAME on repository directory when diffing Modified: cl-darcs/trunk/diff.lisp ============================================================================== --- cl-darcs/trunk/diff.lisp (original) +++ cl-darcs/trunk/diff.lisp Thu Nov 22 08:52:39 2007 @@ -119,7 +119,7 @@ "Find changes in REPO from pristine tree. Return a list of patches. ORIGINAL and MODIFIED specify directories to start from." - (setf repo (fad:pathname-as-directory repo)) + (setf repo (truename (fad:pathname-as-directory repo))) (unless (and original modified) (setf modified repo) (setf original (upath-subdir repo '("_darcs" "pristine")))) From mhenoch at common-lisp.net Sun Nov 25 21:11:09 2007 From: mhenoch at common-lisp.net (mhenoch at common-lisp.net) Date: Sun, 25 Nov 2007 16:11:09 -0500 (EST) Subject: [Cl-darcs-cvs] r148 - cl-darcs/trunk Message-ID: <20071125211109.212FD1B02F@common-lisp.net> Author: mhenoch Date: Sun Nov 25 16:11:09 2007 New Revision: 148 Modified: cl-darcs/trunk/cl-darcs.asd cl-darcs/trunk/cmdline.lisp Log: Use getopt library. Use it for "init" command. Modified: cl-darcs/trunk/cl-darcs.asd ============================================================================== --- cl-darcs/trunk/cl-darcs.asd (original) +++ cl-darcs/trunk/cl-darcs.asd Sun Nov 25 16:11:09 2007 @@ -22,7 +22,8 @@ ;; Regexps :cl-ppcre ;; Diff - :cl-difflib) + :cl-difflib + :getopt) :components ((:file "packages") Modified: cl-darcs/trunk/cmdline.lisp ============================================================================== --- cl-darcs/trunk/cmdline.lisp (original) +++ cl-darcs/trunk/cmdline.lisp Sun Nov 25 16:11:09 2007 @@ -90,6 +90,20 @@ Usage: darcs whatsnew" (diff-repo-display (find-repo))) -(define-darcs-command init () - "Initialize a darcs repository in the current directory." - (create-repo (truename *default-pathname-defaults*))) +(define-darcs-command init (&rest args) + "Initialize a darcs repository in the current directory. + +Options: +--repodir=DIRECTORY Use DIRECTORY instead of current directory" + (multiple-value-bind (operands options errors) + (getopt:getopt args + '(("repodir" :required))) + (declare (ignore operands)) + (if errors + (progn + (format *error-output* "Invalid arguments: ~{ ~A ~}~%" errors) + 1) + (let ((repodir (or (cdr (assoc "repodir" options :test #'string=)) + *default-pathname-defaults*))) + (format t "Creating repo in ~S...~%" repodir) + (create-repo (truename repodir))))))