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

Contents of /meta-cvs/F-993DC8DDEC493F0D641AC0C23DB6BAB0

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23.2.1 - (show annotations)
Sat Oct 26 18:54:43 2002 UTC (11 years, 5 months ago) by kaz
Branch: mcvs-1-0-branch
CVS Tags: mcvs-1-0, mcvs-0-99, mcvs-1-0-5, mcvs-1-0-4, mcvs-1-0-1, mcvs-1-0-2
Changes since 1.23: +3 -3 lines
* 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.
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 "chatter")
8 (require "find-bind")
9 (provide "remove")
10
11 (defun mcvs-remove (recursivep files &key no-sync)
12 (when (null files)
13 (return-from mcvs-remove (values)))
14
15 (in-sandbox-root-dir
16 (let (files-to-remove (filemap (mapping-read *mcvs-map*)))
17
18 (chatter-debug "Unmapping.~%")
19 (dolist (file files)
20 (can-restart-here ("Continue unmapping files.")
21 (let* ((full-name (sandbox-translate-path file))
22 (abs-name (canonicalize-path
23 (real-to-abstract-path full-name)))
24 (entries (mapping-prefix-matches filemap abs-name)))
25 (cond
26 ((path-prefix-equal *mcvs-dir* full-name)
27 (error "cannot remove ~a: path is in a reserved Meta-CVS area."
28 full-name))
29 ((and (second entries) (not recursivep))
30 (error "cannot remove ~a: it is a directory, use -R to remove."
31 full-name))
32 ((not entries)
33 (if (exists full-name)
34 (error "cannot remove ~a: it is local, not versioned under Meta-CVS."
35 full-name)
36 (error "cannot remove ~a: it does not exist." full-name)))
37 (t (setf files-to-remove (nconc files-to-remove entries)))))))
38
39 (when files-to-remove
40 (chatter-debug "Synchronizing.~%")
41 (unless no-sync
42 (mapping-synchronize))
43 (let ((new-filemap (set-difference filemap files-to-remove
44 :test #'mapping-same-id-p)))
45 (mapping-write new-filemap *mcvs-map* :sort-map t))
46
47 (chatter-debug "Updating file structure.~%")
48 (mapping-update :no-delete-removed no-sync))))
49 (values))
50
51 (defun mcvs-remove-wrapper (cvs-options cvs-command-options mcvs-args)
52 (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
58 (defconstant *remove-help*
59 "Syntax:
60
61 mcvs remove [ options ] objects ...
62
63 Options:
64
65 -R Recursive behavior: recursively remove objects
66 in subdirectories. By default, trying to remove
67 a subdirectory signals a continuable error.
68
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