/[meta-cvs]/meta-cvs/F-A7A64FB1054A27E5F51A7E95C6A80309
ViewVC logotype

Contents of /meta-cvs/F-A7A64FB1054A27E5F51A7E95C6A80309

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations)
Tue Jun 25 04:57:32 2002 UTC (11 years, 9 months ago) by kaz
Branch: MAIN
Changes since 1.19: +17 -11 lines
* checkout.lisp (mcvs-checkout): New key parameter, no-generate.
Tells the checkout function not to unpack the MCVS directory.
This will be useful when mcvs-checkout is used as a subfunction
of the new grab command. Failed CVS call is now turned into
an error. The MCVS subdirectory is *always* deleted, even if the
checkout did not create the checkout directory.
1 ;;; This source file is part of the Meta-CVS program,
2 ;;; which is distributed under the GNU license.
3 ;;; Copyright 2002 Kaz Kylheku
4
5 (require "dirwalk")
6 (require "chatter")
7 (require "sync")
8 (require "options")
9 (require "find-bind")
10 (provide "checkout")
11
12 (defun mcvs-checkout (module &optional cvs-options checkout-options
13 &key no-generate)
14 ;; checkout module from cvs
15 (find-bind (:key #'first :test #'string= :take #'second)
16 (cvs-checkout-options (dir "d" module))
17 checkout-options
18 (let ((checkout-dir (canonicalize-path dir))
19 path checkout-okay created-dir)
20 (multiple-value-setq (path created-dir)
21 (ensure-directories-exist (path-cat checkout-dir *mcvs-dir*)))
22 (unwind-protect
23 (current-dir-restore
24 (chdir checkout-dir)
25
26 (when (ignore-errors (stat *mcvs-dir*))
27 (error "mcvs-checkout: directory ~a seems to be the root of an existing sandbox."
28 checkout-dir))
29
30 (chatter-debug "Invoking CVS.~%")
31 (unless
32 (execute-program `("cvs" ,@(format-opt cvs-options)
33 "checkout" "-d" ,*mcvs-dir*
34 ,@(format-opt cvs-checkout-options) ,module))
35 (error "CVS checkout failed."))
36
37 (unless (ignore-errors (stat *mcvs-dir*))
38 (error "mcvs-checkout: checkout failed to create ~a directory."
39 *mcvs-dir*))
40
41 (unless no-generate
42 (chatter-debug "Generating file structure.~%")
43 (mapping-write nil *mcvs-map-local*)
44 (mapping-update))
45 (chatter-info "Checkout to directory ~a completed.~%" checkout-dir)
46 (setf checkout-okay t))
47 (unless checkout-okay
48 (delete-recursive (path-cat checkout-dir *mcvs-dir*))
49 (when created-dir
50 (delete-recursive checkout-dir))))
51 (values))))
52
53 (defun mcvs-checkout-wrapper (cvs-options cvs-command-options mcvs-args)
54 (if (< (length mcvs-args) 1)
55 (error "mcvs-checkout: specify module."))
56 (destructuring-bind (module &rest superfluous) mcvs-args
57 (when superfluous
58 (error "mcvs-checkout: specify one module to check out."))
59 (mcvs-checkout module cvs-options cvs-command-options)))

  ViewVC Help
Powered by ViewVC 1.1.5