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

Contents of /meta-cvs/F-AFC09F145399B1273F4BF98702F5BE8C

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.29.2.6 - (show annotations)
Thu May 1 05:39:58 2003 UTC (10 years, 11 months ago) by kaz
Branch: mcvs-1-0-branch
CVS Tags: mcvs-1-0-8
Changes since 1.29.2.5: +2 -1 lines
* code/generic.lisp (mcvs-generic): The after-synchronization
was going in both directions rather than just MCVS -> tree.
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 (provide "generic")
11
12 (defun mcvs-generic (cvs-command cvs-options command-options command-args
13 files &key need-sync-before need-sync-after
14 default-include-meta-files need-update-after
15 global-if-empty-file-list no-invoke-cvs)
16 (in-sandbox-root-dir
17 (let (files-to-process
18 (filemap (mapping-read *mcvs-map-local*))
19 (do-meta-files (and (or *metaonly-option* *meta-option*
20 default-include-meta-files)
21 (not (and (null files)
22 global-if-empty-file-list
23 (not *metaonly-option*)))
24 (not *nometa-option*))))
25
26 (unless (or *metaonly-option*)
27 (chatter-debug "Preparing file list.~%")
28
29 (if (null files)
30 (unless global-if-empty-file-list
31 (setf files-to-process
32 (mapping-prefix-matches filemap
33 (sandbox-translate-path "."))))
34 (dolist (file files)
35 (can-restart-here ("Continue preparing file list.")
36 (let* ((full-name (sandbox-translate-path file))
37 (abs-name (canonicalize-path
38 (real-to-abstract-path full-name)))
39 (entries (mapping-prefix-matches filemap abs-name)))
40 (if (not entries)
41 (error "~a is not known to Meta-CVS." full-name)
42 (setf files-to-process (nconc files-to-process entries))))))))
43
44 (setf files-to-process (mapping-extract-kind files-to-process :file))
45
46 (when (or files-to-process
47 do-meta-files
48 global-if-empty-file-list)
49 (when need-sync-before
50 (chatter-debug "Synchronizing.~%")
51 (mapping-synchronize :filemap files-to-process
52 :direction :left))
53 (unless no-invoke-cvs
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 :filemap files-to-process
77 :direction :right))))
78 (values)))
79
80 (defun mcvs-commit-wrapper (cvs-options cvs-command-options mcvs-args)
81 (mcvs-generic "commit" cvs-options cvs-command-options nil mcvs-args
82 :need-sync-before t
83 :need-sync-after t
84 :default-include-meta-files t
85 :global-if-empty-file-list t))
86
87 (defun mcvs-diff-wrapper (cvs-options cvs-command-options mcvs-args)
88 (mcvs-generic "diff" cvs-options cvs-command-options nil mcvs-args
89 :need-sync-before t))
90
91 (defun mcvs-tag-wrapper (cvs-options cvs-command-options mcvs-args)
92 (if (null mcvs-args)
93 (error "specify tag optionally followed by files."))
94 (mcvs-generic "tag" cvs-options
95 cvs-command-options (list (first mcvs-args)) (rest mcvs-args)
96 :default-include-meta-files t
97 :global-if-empty-file-list t))
98
99 (defun mcvs-log-wrapper (cvs-options cvs-command-options mcvs-args)
100 (mcvs-generic "log" cvs-options cvs-command-options nil mcvs-args))
101
102 (defun mcvs-status-wrapper (cvs-options cvs-command-options mcvs-args)
103 (mcvs-generic "status" cvs-options cvs-command-options nil mcvs-args
104 :need-sync-before t))
105
106 (defun mcvs-annotate-wrapper (cvs-options cvs-command-options mcvs-args)
107 (mcvs-generic "annotate" cvs-options cvs-command-options nil mcvs-args))
108
109 (defun mcvs-watchers-wrapper (cvs-options cvs-command-options mcvs-args)
110 (mcvs-generic "watchers" cvs-options cvs-command-options nil mcvs-args))
111
112 (defun mcvs-edit-wrapper (cvs-options cvs-command-options mcvs-args)
113 (mcvs-generic "edit" cvs-options cvs-command-options nil mcvs-args
114 :need-sync-before t))
115
116 (defun mcvs-unedit-wrapper (cvs-options cvs-command-options mcvs-args)
117 (mcvs-generic "unedit" cvs-options cvs-command-options nil mcvs-args
118 :need-sync-before t
119 :need-sync-after t))
120
121 (defun mcvs-editors-wrapper (cvs-options cvs-command-options mcvs-args)
122 (mcvs-generic "editors" cvs-options cvs-command-options nil mcvs-args))
123
124 (defun mcvs-sync-to-wrapper (cvs-options cvs-command-options mcvs-args)
125 (mcvs-generic "" cvs-options cvs-command-options nil mcvs-args
126 :need-sync-before t
127 :no-invoke-cvs t))
128
129 (defun mcvs-sync-from-wrapper (cvs-options cvs-command-options mcvs-args)
130 (mcvs-generic "" cvs-options cvs-command-options nil mcvs-args
131 :need-sync-after t
132 :no-invoke-cvs t))

  ViewVC Help
Powered by ViewVC 1.1.5