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

Contents of /meta-cvs/F-AFC09F145399B1273F4BF98702F5BE8C

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.32 - (show annotations)
Sun Jan 12 20:52:31 2003 UTC (11 years, 3 months ago) by kaz
Branch: MAIN
Changes since 1.31: +2 -2 lines
Merging from mcvs-1-0-branch.

Hard link sync optimization.

* code/mapping.lisp (mapping-synchronize): New optional parameter,
specifies map to use instead of reading *map-local*.

* code/mcvs-generic.lisp (mcvs-generic): Pass extra parameter to
mapping-synchronize to only sync the selected subset of files.
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 "system")
6 (require "mapping")
7 (require "types")
8 (require "chatter")
9 (require "options")
10 (require "mcvs-package")
11 (provide "generic")
12
13 (in-package "META-CVS")
14
15 (defun mcvs-generic (cvs-command cvs-options command-options command-args
16 files &key need-sync-after default-include-meta-files
17 need-update-after no-fix-empty-file-list)
18 (in-sandbox-root-dir
19 (let (files-to-process
20 (filemap (mapping-read *mcvs-map-local*))
21 (do-meta-files (and (or *metaonly-option* *meta-option*
22 default-include-meta-files)
23 (not (and (null files)
24 no-fix-empty-file-list
25 (not *metaonly-option*)))
26 (not *nometa-option*))))
27
28 (unless (or *metaonly-option*)
29 (chatter-debug "Preparing file list.~%")
30
31 (if (null files)
32 (unless no-fix-empty-file-list
33 (setf files-to-process
34 (mapping-prefix-matches filemap
35 (sandbox-translate-path "."))))
36 (dolist (file files)
37 (can-restart-here ("Continue preparing file list.")
38 (let* ((full-name (sandbox-translate-path file))
39 (abs-name (canonicalize-path
40 (real-to-abstract-path full-name)))
41 (entries (mapping-prefix-matches filemap abs-name)))
42 (if (not entries)
43 (error "~a is not known to Meta-CVS." full-name)
44 (setf files-to-process (nconc files-to-process entries))))))))
45
46 (setf files-to-process (mapping-extract-kind files-to-process :file))
47
48 (when (or files-to-process
49 do-meta-files
50 no-fix-empty-file-list)
51 (chatter-debug "Synchronizing.~%")
52 (mapping-synchronize files-to-process)
53
54 (current-dir-restore
55 (chdir *mcvs-dir*)
56 (chatter-debug "Invoking CVS.~%")
57 (execute-program-xargs `("cvs" ,@(format-opt cvs-options)
58 ,cvs-command ,@(format-opt command-options)
59 ,@command-args)
60 `(,@(when do-meta-files
61 (let (metas)
62 (when (exists ".cvsignore")
63 (push ".cvsignore" metas))
64 (when (exists *mcvs-types-name*)
65 (push *mcvs-types-name* metas))
66 (cons *mcvs-map-name* metas)))
67 ,@(mapcar #'(lambda (x)
68 (basename
69 (mapping-entry-id x)))
70 files-to-process))))
71 (when (and do-meta-files need-update-after)
72 (chatter-debug "Updating file structure.~%")
73 (mapping-update))
74 (when need-sync-after
75 (chatter-debug "Synchronizing again.~%")
76 (mapping-synchronize files-to-process))))
77 (values)))
78
79 (defun mcvs-commit-wrapper (cvs-options cvs-command-options mcvs-args)
80 (mcvs-generic "commit" cvs-options cvs-command-options nil mcvs-args
81 :default-include-meta-files t
82 :no-fix-empty-file-list t))
83
84 (defun mcvs-diff-wrapper (cvs-options cvs-command-options mcvs-args)
85 (mcvs-generic "diff" cvs-options cvs-command-options nil mcvs-args))
86
87 (defun mcvs-tag-wrapper (cvs-options cvs-command-options mcvs-args)
88 (if (null mcvs-args)
89 (error "specify tag optionally followed by files."))
90 (mcvs-generic "tag" cvs-options
91 cvs-command-options (list (first mcvs-args)) (rest mcvs-args)
92 :default-include-meta-files t))
93
94 (defun mcvs-log-wrapper (cvs-options cvs-command-options mcvs-args)
95 (mcvs-generic "log" cvs-options cvs-command-options nil mcvs-args))
96
97 (defun mcvs-status-wrapper (cvs-options cvs-command-options mcvs-args)
98 (mcvs-generic "status" cvs-options cvs-command-options nil mcvs-args))
99
100 (defun mcvs-annotate-wrapper (cvs-options cvs-command-options mcvs-args)
101 (mcvs-generic "annotate" cvs-options cvs-command-options nil mcvs-args))
102
103 (defun mcvs-watchers-wrapper (cvs-options cvs-command-options mcvs-args)
104 (mcvs-generic "watchers" cvs-options cvs-command-options nil mcvs-args))
105
106 (defun mcvs-edit-wrapper (cvs-options cvs-command-options mcvs-args)
107 (mcvs-generic "edit" cvs-options cvs-command-options nil mcvs-args))
108
109 (defun mcvs-unedit-wrapper (cvs-options cvs-command-options mcvs-args)
110 (mcvs-generic "unedit" cvs-options cvs-command-options nil mcvs-args
111 :need-sync-after t))
112
113 (defun mcvs-editors-wrapper (cvs-options cvs-command-options mcvs-args)
114 (mcvs-generic "editors" cvs-options cvs-command-options nil mcvs-args))

  ViewVC Help
Powered by ViewVC 1.1.5