/[meta-cvs]/meta-cvs/F-233AD6EEE14894A7303F09519A2AB734
ViewVC logotype

Contents of /meta-cvs/F-233AD6EEE14894A7303F09519A2AB734

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.69.2.12 - (hide annotations)
Sun Nov 3 20:31:16 2002 UTC (11 years, 5 months ago) by kaz
Branch: mcvs-1-0-branch
Changes since 1.69.2.11: +1 -1 lines
* code/branch.lisp (*branch-help*): New string constant.

* code/mcvs-main.lisp (*mcvs-command-table*): *branch-help* hooked in.
1 kaz 1.16 ;;; This source file is part of the Meta-CVS program,
2 kaz 1.7 ;;; which is distributed under the GNU license.
3     ;;; Copyright 2002 Kaz Kylheku
4    
5 kaz 1.69.2.7 ;; Clear out requires for mcvs-upgrade to work right.
6     (setf *modules* nil)
7    
8 kaz 1.45 (require "create")
9 kaz 1.1 (require "checkout")
10 kaz 1.46 (require "grab")
11 kaz 1.1 (require "add")
12 kaz 1.3 (require "remove")
13 kaz 1.4 (require "move")
14 kaz 1.69.2.10 (require "link")
15 kaz 1.1 (require "update")
16 kaz 1.12 (require "filt")
17 kaz 1.21 (require "generic")
18 kaz 1.25 (require "convert")
19 kaz 1.38 (require "branch")
20 kaz 1.44 (require "remap")
21 kaz 1.48 (require "purge")
22 kaz 1.49 (require "restore")
23 kaz 1.54 (require "prop")
24 kaz 1.69.2.3 (require "watch")
25 kaz 1.8 (require "split")
26     (require "restart")
27 kaz 1.27 (require "error")
28 kaz 1.10 (require "options")
29 kaz 1.33 (require "find-bind")
30 kaz 1.6 (provide "mcvs-main")
31 kaz 1.5
32 kaz 1.55 (define-option-constant *cvs-options*
33     (0 arg "H" "help" "Q" "q" "r" "w" "l" "n" "t" "v" "f" "version"
34 kaz 1.69 "meta" "metaonly" "nometa" "error-continue" "error-terminate"
35     "debug")
36 kaz 1.65 (1 arg "T" "e" "d" "r" "z" "s" "i"))
37 kaz 1.55
38 kaz 1.58 (define-option-constant *help-options*)
39    
40 kaz 1.55 (define-option-constant *create-options*
41     (0 arg "d")
42     (1 arg "k" "I" "b" "m" "W"))
43    
44     (define-option-constant *grab-options*
45     (0 arg "A")
46     (1 arg "r"))
47    
48     (define-option-constant *checkout-options*
49 kaz 1.61 (0 arg "f")
50 kaz 1.55 (1 arg "r" "D" "d" "k" "j"))
51    
52 kaz 1.69.2.2 (define-option-constant *export-options*
53     (0 arg "f")
54     (1 arg "r" "D" "d" "k"))
55    
56 kaz 1.55 (define-option-constant *add-options*
57     (0 arg "R")
58     (1 arg "k" "m"))
59    
60     (define-option-constant *remove-options*
61     (0 arg "R"))
62    
63     (define-option-constant *update-options*
64 kaz 1.69.2.1 (0 arg "A" "C" "f" "p")
65 kaz 1.55 (1 arg "k" "r" "D" "j" "I" "W"))
66    
67     (define-option-constant *switch-options*
68     (1 arg "k" "I" "W"))
69    
70     (define-option-constant *commit-options*
71     (0 arg "f")
72     (1 arg "F" "m" "r"))
73    
74     (define-option-constant *diff-options*
75     (0 arg "a" "b" "B" "brief" "c" "d" "e" "ed" "expand-tabs" "f" "forward-ed"
76     "H" "i" "ignore-all-space" "ignore-blank-lines" "ignore-case"
77     "ignore-space-change" "initial-tab" "l" "left-column" "minimal" "n"
78     "N" "new-file" "p" "P" "--paginate" "q" "rcs" "report-identical-files"
79     "s" "show-c-function" "side-by-side" "speed-large-files"
80     "suppress-common-lines" "t" "T" "text" "u" "unidirectional-new-file"
81     "w" "y")
82     (1 arg "C" "context" "D" "F" "horizon-lines" "ifdef" "ignore-matching-lines"
83     "L" "label" "line-format" "new-group-format" "new-line-format"
84     "old-group-format" "old-line-format" "r" "show-function-line"
85     "unchanged-group-format" "unchanged-line-format" "U" "unified" "W"
86     "width"))
87    
88     (define-option-constant *tag-options*
89     (0 arg "l" "d" "f" "b" "F" "c")
90     (1 arg "r" "D"))
91    
92     (define-option-constant *log-options*
93     (0 arg "R" "h" "t" "N" "b")
94     (1 arg "r" "d" "s" "w"))
95    
96     (define-option-constant *status-options*
97     (0 arg "v"))
98    
99     (define-option-constant *annotate-options*
100     (0 arg "f")
101     (1 arg "r" "D"))
102    
103     (define-option-constant *filt-options*
104     (1 arg "r" "D"))
105    
106 kaz 1.57 (define-option-constant *move-options*)
107 kaz 1.69.2.10 (define-option-constant *link-options*)
108 kaz 1.55 (define-option-constant *convert-options*)
109     (define-option-constant *branch-options*)
110     (define-option-constant *merge-options*)
111     (define-option-constant *remerge-options*)
112     (define-option-constant *list-branches-options*)
113     (define-option-constant *remap-options*)
114     (define-option-constant *purge-options*)
115     (define-option-constant *restore-options*)
116    
117     (define-option-constant *prop-options*
118     (1 arg "set" "clear" "remove")
119     (2 arg "value"))
120 kaz 1.18
121 kaz 1.69.2.3 (define-option-constant *watch-options*
122     (0 arg "on" "off")
123     (1 arg "add" "remove"))
124    
125 kaz 1.69.2.5 (define-option-constant *watchers-options*)
126     (define-option-constant *edit-options*)
127     (define-option-constant *unedit-options*)
128     (define-option-constant *editors-options*)
129    
130 kaz 1.58 (defun mcvs-help (global-options command-options args)
131     (declare (special *usage* *mcvs-command-table*)
132     (ignore global-options command-options))
133     (cond
134     ((null args)
135     (terpri)
136     (write-line *usage*)
137     (terpri))
138     ((= (length args) 1)
139     (let* ((command-name (first args))
140     (command (find command-name *mcvs-command-table*
141     :key #'first
142     :test #'string=)))
143     (when (null command)
144 kaz 1.69 (error "~a is not a recognized mcvs command."
145 kaz 1.58 command-name))
146 kaz 1.59 (let ((help-text (third command)))
147     (when (null help-text)
148 kaz 1.69 (error "sorry, no help available for ~a command."
149 kaz 1.58 command-name))
150 kaz 1.59 (terpri)
151     (write-line help-text)
152     (terpri))))
153 kaz 1.69 (t (error "try \"mcvs help <name-of-command>\"."))))
154 kaz 1.58
155 kaz 1.5 (defconstant *mcvs-command-table*
156 kaz 1.58 `(("help" ,#'mcvs-help nil ,*help-options*)
157 kaz 1.59 ("create" ,#'mcvs-create-wrapper ,*create-help* ,*create-options*)
158 kaz 1.60 ("grab" ,#'mcvs-grab-wrapper ,*grab-help* ,*grab-options*)
159 kaz 1.61 ("checkout" ,#'mcvs-checkout-wrapper ,*checkout-help* ,*checkout-options*)
160     ("co" ,#'mcvs-checkout-wrapper ,*checkout-help* ,*checkout-options*)
161 kaz 1.69.2.2 ("export" ,#'mcvs-export-wrapper ,*export-help* ,*export-options*)
162     ("ex" ,#'mcvs-export-wrapper ,*export-help* ,*export-options*)
163 kaz 1.61 ("add" ,#'mcvs-add-wrapper ,*add-help* ,*add-options*)
164 kaz 1.63 ("remove" ,#'mcvs-remove-wrapper ,*remove-help* ,*remove-options*)
165 kaz 1.64 ("rm" ,#'mcvs-remove-wrapper ,*remove-help* ,*remove-options*)
166 kaz 1.69.2.8 ("move" ,#'mcvs-move-wrapper ,*move-help* ,*move-options*)
167     ("mv" ,#'mcvs-move-wrapper ,*move-help* ,*move-options*)
168 kaz 1.69.2.10 ("link" ,#'mcvs-link-wrapper ,*link-help* ,*link-options*)
169     ("ln" ,#'mcvs-link-wrapper ,*link-help* ,*link-options*)
170 kaz 1.58 ("update" ,#'mcvs-update-wrapper nil ,*update-options*)
171     ("up" ,#'mcvs-update-wrapper nil ,*update-options*)
172     ("commit" ,#'mcvs-commit-wrapper nil ,*commit-options*)
173     ("ci" ,#'mcvs-commit-wrapper nil ,*commit-options*)
174     ("diff" ,#'mcvs-diff-wrapper nil ,*diff-options*)
175     ("tag" ,#'mcvs-tag-wrapper nil ,*tag-options*)
176     ("log" ,#'mcvs-log-wrapper nil ,*log-options*)
177     ("status" ,#'mcvs-status-wrapper nil ,*status-options*)
178     ("stat" ,#'mcvs-status-wrapper nil ,*status-options*)
179     ("annotate" ,#'mcvs-annotate-wrapper nil ,*annotate-options*)
180     ("filt" ,#'mcvs-filt-wrapper nil ,*filt-options*)
181     ("fi" ,#'mcvs-filt-wrapper nil ,*filt-options*)
182     ("convert" ,#'mcvs-convert-wrapper nil ,*convert-options*)
183 kaz 1.69.2.12 ("branch" ,#'mcvs-branch-wrapper ,*branch-help* ,*branch-options*)
184 kaz 1.58 ("switch" ,#'mcvs-switch-wrapper nil ,*switch-options*)
185     ("sw" ,#'mcvs-switch-wrapper nil ,*switch-options*)
186     ("merge" ,#'mcvs-merge-wrapper nil ,*merge-options*)
187     ("remerge" ,#'mcvs-remerge-wrapper nil ,*remerge-options*)
188     ("list-branches" ,#'mcvs-list-branches-wrapper nil ,*list-branches-options*)
189     ("lb" ,#'mcvs-list-branches-wrapper nil ,*list-branches-options*)
190     ("purge" ,#'mcvs-purge-wrapper nil ,*purge-options*)
191     ("restore" ,#'mcvs-restore-wrapper nil ,*restore-options*)
192     ("remap" ,#'mcvs-remap-wrapper nil ,*remap-options*)
193 kaz 1.69.2.3 ("prop" ,#'mcvs-prop-wrapper nil ,*prop-options*)
194 kaz 1.69.2.5 ("watch" ,#'mcvs-watch-wrapper nil ,*watch-options*)
195     ("watchers" ,#'mcvs-watchers-wrapper nil ,*watchers-options*)
196     ("edit" ,#'mcvs-edit-wrapper nil ,*edit-options*)
197     ("unedit" ,#'mcvs-unedit-wrapper nil ,*unedit-options*)
198     ("editors" ,#'mcvs-editors-wrapper nil ,*editors-options*)))
199 kaz 1.5
200 kaz 1.33 (defconstant *usage*
201     "Meta-CVS command syntax:
202    
203 kaz 1.59 mcvs [ global-options] command [ command-options ] [ command-arguments ]
204 kaz 1.33
205     Global options:
206    
207 kaz 1.35 -H --help Print this help and terminate. If a command is specified,
208     help specific to that command is printed instead.
209     -Q Very quiet, generate output only for serious problems. (*)
210     -q Somewhat quiet, some informational messages suppresed. (*)
211 kaz 1.69 --debug Verbose debug output; -Q and -q are ignored but still
212     passed to CVS.
213 kaz 1.35 -r Make working files read-only. (@)
214     -w Make new working files read-write (default). (@)
215     -l Do not log cvs command in command history, but execute
216     it anyway. (@)
217     -t Trace CVS execution. (@)
218     -v --version Display version information and terminate.
219     -f CVS not to read ~/.cvsrc file. (@)
220 kaz 1.65 -i script-name Load a Lisp file and evaluate its top level forms,
221     allowing Meta-CVS to behave as an interpreter.
222 kaz 1.50 --meta Include metafiles such as MCVS/MAP in the set of files
223     to operate on.
224     --metaonly Operate only on metafiles.
225     --nometa Exclude metafiles from the set of files to operate on.
226 kaz 1.35 --error-continue Instead of interactive error handling, automatically
227     continue all continuable errors.
228     --error-terminate Terminate without cleanup when an error happens instead
229     of interactive error handling (use with care).
230     -T tempdir Place temporary files in tempdir. (@)
231     -e editor Edit messages with editor. (*)
232     -d root Specify CVSROOT. (@)
233     -z gzip-level Specify compression level. (@)
234 kaz 1.33
235     Notes: (*) option processed by Meta-CVS and passed to CVS too.
236     (@) option merely passed to CVS.
237    
238     Commands:
239    
240 kaz 1.59 help Obtain more detailed help for a specific command.
241 kaz 1.45 create Create new project from an existing file tree.
242 kaz 1.46 grab Take a snapshot of an external source tree, such
243     as a third-party release, and incorporate it into
244     the working copy. Tries to discover file moves.
245 kaz 1.69.2.4 checkout (co) Retrieve a Meta-CVS project from the repository to
246     create a working copy.
247     export (ex) Retrieve a Meta-CVS project without creating a
248 kaz 1.35 working copy.
249     add Place files (or directories with add -R) under
250     version control.
251     remove (rm) Remove files or directories.
252     move (mv) Rename files and directories.
253 kaz 1.69.2.10 link (ln) Create a versioned symbolic link.
254 kaz 1.35 update (up) Incorporate latest changes from repository into
255     working copy.
256     commit (ci) Incorporate outstanding changes in the working copy
257     into the repository.
258     diff Compute differences between files in the working copy
259     and the repository or between revisions in the repository.
260     tag Associate a symbolic name with file revisions to create
261     an identifiable baseline. By default, tags the
262     revisions that were last synchronized with the
263     directory. A branch is created using tag -b.
264     log Display log information for files.
265     status (stat) Show current status of files.
266     annotate Perform a detailed analysis of files, showing the
267     version information about every individual line of text.
268     filt (fi) Act as a text filter, which converts Meta-CVS F- file
269     names to readable paths, according to the current mapping.
270 kaz 1.38 branch Create a managed branch. Meta-CVS managed branches keep
271     track of what has been merged where, so users don't have
272     to track merges with tags at all.
273     merge Merge a managed branch to the current branch or trunk.
274 kaz 1.40 remerge Re-apply the most recent merge without changing any tags.
275     Useful when a merge goes bad so the local changes have
276     to be discarded and the merge done over again.
277 kaz 1.41 list-branches (lb) List Meta-CVS managed branches.
278 kaz 1.43 switch (sw) Switch to a branch. With no arguments, switch to
279 kaz 1.42 main trunk.
280 kaz 1.44 remap Force Meta-CVS to notice and incorporate moves and
281     deletions that were performed directly on the sandbox.
282 kaz 1.48 purge Execute a CVS remove on files that have been unmapped
283     with the remove command.
284 kaz 1.51 restore Restore files that have been deleted with the remove
285     command, but not purged. These appear in the lost+found
286     directory under cryptic names.
287 kaz 1.54 prop Manipulate properties.
288 kaz 1.56 prop --set <bool-prop-name> [ files ... ]
289 kaz 1.69.2.9 prop --clear <bool-prop-name> [ files ... ]
290     prop --value <prop-name> <new-value> [ files ... ]
291     prop --remove <prop-name> [ files ... ]
292     The ``exec'' property represents the execute permission
293     of a file. More than one --set, --clear, --value
294     or --remove may be specified before the files.
295 kaz 1.69.2.4 watch Manipulate per-file CVS watch settings.
296     watch --on [ files ... ]
297     watch --off [ files ... ]
298     watch --add <action> [ files ... ]
299     watch --remove <action> [ files ... ]
300 kaz 1.69.2.5 watchers See who is watching files.
301     edit Indicate the intent to edit a watched file.
302     unedit Retract the indication signaled by edit.
303     editors See who is editing files.
304 kaz 1.35 convert Convert a CVS module to a Meta-CVS project. This requires
305     filesystem-level access to the repository. This is
306     currently an experimental command that is known not
307     to work 100%.")
308 kaz 1.33
309 kaz 1.5 (defun mcvs-execute (args)
310 kaz 1.27 (handler-bind ((error #'mcvs-error-handler))
311 kaz 1.18 (multiple-value-bind (global-options global-args)
312 kaz 1.55 (parse-opt args *cvs-options*)
313 kaz 1.33 (setf global-options (filter-global-options global-options))
314    
315 kaz 1.69.2.11 (when *print-usage*
316     (terpri)
317     (write-line *usage*)
318     (terpri)
319     (throw 'mcvs-terminate nil))
320 kaz 1.33
321 kaz 1.18 (when (not (first global-args))
322 kaz 1.35 (write-line "Meta-CVS requires a command argument.")
323 kaz 1.33 (write-line "Use mcvs -H to view help.")
324     (throw 'mcvs-terminate nil))
325    
326 kaz 1.18 (let ((command (find (first global-args) *mcvs-command-table*
327 kaz 1.55 :key #'first
328     :test #'string=)))
329 kaz 1.11 (when (not command)
330 kaz 1.69 (error "~a is not a recognized mcvs command."
331 kaz 1.18 (first global-args)))
332 kaz 1.58 (destructuring-bind (name func help-text opt-spec) command
333     (declare (ignore name help-text))
334 kaz 1.68 (multiple-value-bind (command-options command-args)
335     (parse-opt (rest global-args) opt-spec)
336     (funcall func global-options command-options command-args))))))
337 kaz 1.18 nil)
338 kaz 1.5
339 kaz 1.8 (defun mcvs-debug-shell ()
340 kaz 1.24 (let ((counter 0)
341     (*mcvs-error-treatment* :decline))
342     (loop
343     (format t "~&mcvs[~a]> " (incf counter))
344     (let ((line (string-trim #(#\space #\tab) (read-line))))
345 kaz 1.29 (restart-case
346 kaz 1.24 (cond
347     ((zerop (length line)))
348     ((string-equal line "exit")
349     (return-from mcvs-debug-shell))
350     ((char-equal (char line 0) #\!)
351     (print (eval (read-from-string (subseq line 1)))))
352 kaz 1.29 (t (mcvs-execute (split-words line #(#\space #\tab)))))
353 kaz 1.36 (debug () :report "Return to mcvs debug shell"
354 kaz 1.29 (terpri)))))))
355 kaz 1.10
356 kaz 1.5 #+clisp
357     (defun mcvs ()
358 kaz 1.28 (exit (catch 'mcvs-terminate (or (mcvs-execute ext:*args*)
359     *mcvs-errors-occured-p*))))

  ViewVC Help
Powered by ViewVC 1.1.5