/[meta-cvs]/meta-cvs/F-FA1826D235E55390A70DEBE51DC3234B.lisp
ViewVC logotype

Contents of /meta-cvs/F-FA1826D235E55390A70DEBE51DC3234B.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations)
Mon Mar 8 06:11:41 2004 UTC (10 years, 1 month ago) by kaz
Branch: MAIN
CVS Tags: mcvs-1-1-0
Changes since 1.9: +0 -5 lines
Revamped loading system. Got rid of require/provide in all
Lisp source files.

* code/mcvs.lisp: New file. Responsible for compiling and loading
everything in the right order.

* code/mcvs-main.lisp: File renamed to main.lisp.

* code/mcvs-package.lisp: File renamed to package.lisp.

* code/system.lisp: File removed.
1 kaz 1.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 kaz 1.7 (in-package "META-CVS")
6 kaz 1.1
7     (defun mcvs-remap ()
8     (in-sandbox-root-dir
9 kaz 1.3 (let* ((old-mapping (mapping-read *mcvs-map-local*))
10     (cvs-mapping (mapping-read *mcvs-map*))
11     (inode-hash (make-hash-table :test #'eql))
12 kaz 1.4 (new-mapping (remove-if #'(lambda (entry)
13     (with-slots (path kind) entry
14     (and (eq kind :file)
15     (real-path-exists path))))
16     old-mapping)))
17 kaz 1.2 (restart-case
18 kaz 1.4 (when (not (equal-filemaps old-mapping cvs-mapping))
19 kaz 1.5 (error "local and repository mappings differ."))
20 kaz 1.8 (continue () :report "remap anyway, clobbering repository mapping"))
21 kaz 1.1 (dolist (entry old-mapping)
22 kaz 1.4 (with-slots (id kind) entry
23     (when (eq kind :file)
24 kaz 1.9 (let ((file-info (no-existence-error (stat id))))
25     (unless file-info
26     (restart-case
27     (error "~a does not exist." id)
28     (continue () :report "Remove it from the map.")))
29     (when file-info
30     (setf (gethash (inode file-info) inode-hash) entry))))))
31 kaz 1.1 (for-each-file-info (fi ".")
32 kaz 1.3 (let* ((path (canonicalize-path (file-name fi)))
33     (abs-path (real-to-abstract-path path)))
34 kaz 1.1 (cond
35     ((regular-p fi)
36 kaz 1.6 (let ((entry (gethash (inode fi) inode-hash)))
37     (when entry
38     (let ((new-entry (copy-mapping-entry entry)))
39     (setf (mapping-entry-executable new-entry)
40     (executable-p fi))
41     (setf (mapping-entry-path new-entry) abs-path)
42     (push new-entry new-mapping)
43     (setf (gethash (inode fi) inode-hash) nil)))))
44 kaz 1.4 ((symlink-p fi)
45     (chatter-info "skipping symbolic link ~a.~%" path))
46 kaz 1.1 ((directory-p fi)
47     (when (path-equal path *mcvs-dir*)
48     (skip))))))
49     (mapping-write new-mapping *mcvs-map-local* :sort-map t)
50     (mapping-write new-mapping *mcvs-map* :sort-map t))))
51    
52     (defun mcvs-remap-wrapper (global-options command-options args)
53     (declare (ignore global-options command-options))
54     (when args
55 kaz 1.5 (error "command takes no arguments."))
56 kaz 1.1 (mcvs-remap))

  ViewVC Help
Powered by ViewVC 1.1.5