/[meta-cvs]/meta-cvs/F-993DC8DDEC493F0D641AC0C23DB6BAB0
ViewVC logotype

Contents of /meta-cvs/F-993DC8DDEC493F0D641AC0C23DB6BAB0

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (hide annotations)
Sat Oct 26 18:56:29 2002 UTC (11 years, 5 months ago) by kaz
Branch: MAIN
Changes since 1.23: +3 -3 lines
Merging from mcvs-1-0-branch.

* code/mcvs-main.lisp (*usage*): Expand tabs to spaces.

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

* code/remove.lisp (*remove-help*): Likewise.

* code/create.lisp (*create-help*): Likewise.

* code/purge.lisp (mcvs-purge): Get rid the processing of the
nonexistent -n option from purge code.  The global option -n does an
adequate job of implementing a dry run.

* code/mapping.lisp (mapping-removed-files): Skip over the MCVS/CVS
directory, which can contain CVS-generated files with F- names and a ,t
suffix. These trip up the algorithm.
1 kaz 1.10 ;;; This source file is part of the Meta-CVS program,
2 kaz 1.8 ;;; 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.15 (require "find-bind")
9 kaz 1.1 (provide "remove")
10    
11 kaz 1.18 (defun mcvs-remove (recursivep files &key no-sync)
12 kaz 1.11 (when (null files)
13     (return-from mcvs-remove (values)))
14    
15 kaz 1.5 (in-sandbox-root-dir
16 kaz 1.11 (let (files-to-remove (filemap (mapping-read *mcvs-map*)))
17 kaz 1.1
18 kaz 1.13 (chatter-debug "Unmapping.~%")
19 kaz 1.1 (dolist (file files)
20     (can-restart-here ("Continue unmapping files.")
21 kaz 1.5 (let* ((full-name (sandbox-translate-path file))
22 kaz 1.23 (abs-name (canonicalize-path
23     (real-to-abstract-path full-name)))
24 kaz 1.19 (entries (mapping-prefix-matches filemap abs-name)))
25 kaz 1.16 (cond
26     ((path-prefix-equal *mcvs-dir* full-name)
27 kaz 1.22 (error "cannot remove ~a: path is in a reserved Meta-CVS area."
28 kaz 1.16 full-name))
29     ((and (second entries) (not recursivep))
30 kaz 1.22 (error "cannot remove ~a: it is a directory, use -R to remove."
31 kaz 1.16 full-name))
32 kaz 1.17 ((not entries)
33     (if (exists full-name)
34 kaz 1.22 (error "cannot remove ~a: it is local, not versioned under Meta-CVS."
35 kaz 1.17 full-name)
36 kaz 1.22 (error "cannot remove ~a: it does not exist." full-name)))
37 kaz 1.17 (t (setf files-to-remove (nconc files-to-remove entries)))))))
38 kaz 1.1
39     (when files-to-remove
40 kaz 1.13 (chatter-debug "Synchronizing.~%")
41 kaz 1.18 (unless no-sync
42     (mapping-synchronize))
43 kaz 1.1 (let ((new-filemap (set-difference filemap files-to-remove
44 kaz 1.20 :test #'mapping-same-id-p)))
45 kaz 1.11 (mapping-write new-filemap *mcvs-map* :sort-map t))
46 kaz 1.1
47 kaz 1.13 (chatter-debug "Updating file structure.~%")
48 kaz 1.18 (mapping-update :no-delete-removed no-sync))))
49 kaz 1.1 (values))
50 kaz 1.6
51 kaz 1.9 (defun mcvs-remove-wrapper (cvs-options cvs-command-options mcvs-args)
52 kaz 1.15 (declare (ignore cvs-options))
53     (find-bind (:test #'string= :key #'first)
54     ((recursivep "R"))
55     cvs-command-options
56     (mcvs-remove recursivep mcvs-args)))
57 kaz 1.21
58     (defconstant *remove-help*
59     "Syntax:
60    
61     mcvs remove [ options ] objects ...
62    
63     Options:
64    
65 kaz 1.24 -R Recursive behavior: recursively remove objects
66     in subdirectories. By default, trying to remove
67     a subdirectory signals a continuable error.
68 kaz 1.21
69     Semantics:
70    
71     The remove command removes objects from the mapping. To propagate
72     the removal to the repository, a commit operation must be invoked.
73    
74     Removed files are not actually subject to a CVS-level erasure; they are
75     merely removed from the map, but still exist in the MCVS subdirectory. Their
76     local modifications are not lost. To actually remove files from CVS,
77     use the purge command. Removed files that have not been purged can be
78     recovered via the restore command which re-creates mapping entries for them
79     in the lost+found directory under machine-generated names; they can then be
80     renamed to more appropriate names. Symbolic links cannot be restored;
81     they exist as mapping entries only.")

  ViewVC Help
Powered by ViewVC 1.1.5