File: restore.lisp

package info (click to toggle)
mcvs 1.0.13-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 668 kB
  • ctags: 648
  • sloc: lisp: 5,091; ansic: 223; sh: 190; makefile: 58
file content (28 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;;; This source file is part of the Meta-CVS program, 
;;; which is distributed under the GNU license.
;;; Copyright 2002 Kaz Kylheku

(require "system")
(require "dirwalk")
(require "mapping")

(defun mcvs-restore ()
  (in-sandbox-root-dir
    (let* ((filemap (mapping-read *mcvs-map* :sanity-check t))
	   (removed-files (mapping-removed-files filemap)))
      (dolist (removed removed-files)
	(push (make-mapping-entry :kind :file
				  :id removed
				  :path (path-cat (real-to-abstract-path 
						    "lost+found")
						  (basename removed))
				  :executable (executable-p removed))
	      filemap))
      (mapping-write filemap *mcvs-map* :sort-map t)
      (mapping-update))))

(defun mcvs-restore-wrapper (global-options command-options args)
  (declare (ignore global-options command-options))
  (when args
    (error "no arguments permitted."))
  (mcvs-restore))