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

Contents of /meta-cvs/F-AFC09F145399B1273F4BF98702F5BE8C

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Sun Feb 3 18:12:10 2002 UTC (12 years, 2 months ago) by kaz
Branch: MAIN
Changes since 1.11: +6 -6 lines
Added workaround for operating system argument passing limitations,
resembling the Unix xargs utility. Also, trimmed some fat
from the basename function.

* clisp-linux.lisp: (*argument-limit*): New constant added.
(arglist-to-command-string): Function removed.
(execute-program): Function removed.
(shell-interpreter): New function, wrapper for CLISP's shell
function, turns exit status into T (success) or NIL (failure).

* diff.lisp (mcvs-diff): Uses execute-program-xargs instead
of execute-program.

* posix.lisp (basename): Does not canonicalize path name. This
turns out to be an unnecessary performance hit in some cases.
(arglist-to-command-string): New function. Similar to what was
removed from clisp-linux, but this one properly escapes all
shell metacharacters.
(execute-program): New function, calls shell-interpreter.
(execute-program-xargs): New function. Takes two argument lists.
Forms one or more command lines by combining the first argument list
with one or more pieces of the second argument list, and
executes each command. The length of the pieces is determined
by the argument passing limit.

* dirwalk.lisp (ensure-directories-gone): Add use of
canonicalize-path because basename doesn't do it.
1 kaz 1.9 ;;; This source file is part of the Meta-CVS program,
2 kaz 1.6 ;;; which is distributed under the GNU license.
3     ;;; Copyright 2002 Kaz Kylheku
4    
5 kaz 1.1 (require "system")
6     (require "mapping")
7     (require "chatter")
8 kaz 1.7 (require "options")
9 kaz 1.1 (provide "diff")
10    
11 kaz 1.5 (defun mcvs-diff (cvs-options diff-options files)
12 kaz 1.3 (in-sandbox-root-dir
13 kaz 1.10 (let (files-to-diff
14     (filemap (mapping-read *mcvs-map-local*)))
15 kaz 1.1
16     (chatter-info "Preparing diff list.~%")
17     (when (null files)
18     (setf files '(".")))
19     (dolist (file files)
20     (can-restart-here ("Continue preparing diff list.")
21 kaz 1.3 (let* ((full-name (sandbox-translate-path file))
22 kaz 1.11 (entries (mapping-prefix-matches filemap full-name)))
23 kaz 1.3 (if (not entries)
24 kaz 1.9 (error "mcvs-diff: ~a is not known to Meta-CVS." full-name)
25 kaz 1.3 (setf files-to-diff (nconc files-to-diff entries))))))
26 kaz 1.1
27     (when files-to-diff
28     (chatter-info "Synchronizing.~%")
29     (mapping-synchronize)
30    
31     (current-dir-restore
32     (chdir *mcvs-dir*)
33     (chatter-info "Invoking CVS.~%")
34 kaz 1.12 (execute-program-xargs `("cvs" ,@(format-opt cvs-options)
35     "diff" ,@(format-opt diff-options))
36     `("MAP"
37     ,@(mapcar #'(lambda (x)
38     (basename (first x)))
39     files-to-diff))))))
40 kaz 1.1 (values)))
41 kaz 1.4
42 kaz 1.7 (defun mcvs-diff-wrapper (cvs-options cvs-command-options mcvs-args)
43     (mcvs-diff cvs-options cvs-command-options mcvs-args))

  ViewVC Help
Powered by ViewVC 1.1.5