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

Contents of /meta-cvs/F-A7A64FB1054A27E5F51A7E95C6A80309

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations)
Tue Sep 17 03:34:25 2002 UTC (11 years, 7 months ago) by kaz
Branch: MAIN
CVS Tags: mcvs-0-95
Changes since 1.23: +44 -0 lines
* code/mcvs-main.lisp (*checkout-options*): Removed -A and -N
options.
(*mcvs-command-table*): Added help for checkout and add.

* code/checkout.lisp (*checkout-help*): New string constant.

* code/add.help (*add-help*): Likewise.

* code/create.lisp (*create-help*): Mention interactive file
type specification.
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 subdir 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" (or subdir module)))
17 checkout-options
18 (let ((checkout-dir (canonicalize-path dir))
19 path checkout-okay created-dir created-mcvs-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 (setf created-mcvs-dir t)
42 (mapping-write nil *mcvs-map-local*)
43 (if subdir
44 (displaced-path-write (concatenate 'string
45 (canonicalize-path subdir)
46 *path-sep*)))
47 (unless no-generate
48 (in-sandbox-root-dir
49 (chatter-debug "Generating file structure.~%")
50 (mapping-update)))
51 (chatter-info "Checkout to directory ~a completed.~%" checkout-dir)
52 (setf checkout-okay t))
53 (unless checkout-okay
54 (when created-mcvs-dir
55 (delete-recursive (path-cat checkout-dir *mcvs-dir*)))
56 (when created-dir
57 (delete-recursive checkout-dir))))
58 (values))))
59
60 (defun mcvs-checkout-wrapper (cvs-options cvs-command-options mcvs-args)
61 (if (< (length mcvs-args) 1)
62 (error "mcvs-checkout: specify module, and optional subdirectory."))
63 (destructuring-bind (module &optional subdir &rest superfluous) mcvs-args
64 (when superfluous
65 (error "mcvs-checkout: specify one module and optional subdirectory to check out."))
66 (mcvs-checkout module subdir cvs-options cvs-command-options)))
67
68 (defconstant *checkout-help*
69 "Syntax:
70
71 mcvs co [ options ] module-name [ subdirectory-path ]
72
73 Options:
74
75 -f Force a head revision match if tag or date is not found.
76 -r revision Check out specific revision or branch and make it sticky.
77 -D date Check out by date.
78 -d dir Check out into specified directory instead of creating
79 a directory based on the module name.
80 -k key-expansion Specify RCS keyword expansion option.
81 -j revision Merge in the changes between current revision and rev.
82 Note that Meta-CVS has branch and merge commands; using
83 the -j options of checkout or update bypasses the
84 Meta-CVS merge system.
85
86 Semantics:
87
88 The checkout command retrieves a module from Meta-CVS to form a working copy,
89 also known as a ``sandbox'' in version control jargon.
90
91 By default, a subdirectory is created whose name is the same as the
92 module-name. The module's directory structure is unfolded down there. An
93 alternate directory can be specified with the -d option. Meta-CVS will
94 try to create the checkout directory if it does not exist. Populating
95 an existing directory is safe; Meta-CVS will stop if it encounters
96 any conflicting local files.
97
98 If the optional subdirectory-path parameter is specified, Meta-CVS will
99 create a ``partial sandbox'', whose root directory is the specified
100 path. This parameter is understood to be a relative path within the
101 module's tree structure, resolved with respect to the root. For example
102 if the module has a lib/zlib subdirectory, then specifying lib/zlib
103 will create a sandbox whose root directory corresponds to lib/zlib.
104 Files not under lib/zlib won't be visible in the sandbox. A nonexistent
105 path can be specified; in that case the partial sandbox will be empty. Adding
106 new files within the sandbox will cause the path to exist. For example,
107 if the module contains no directory called lib/libdes it's still possible
108 to check out that directory. Then adding a file called foo.c in the
109 root directory of the sandbox will actually add a lib/libdes/foo.c file
110 to the module.")

  ViewVC Help
Powered by ViewVC 1.1.5