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

Diff of /meta-cvs/F-FFF16CA4956A36F19290AC9E1EBAFFD8

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by kaz, Sun Jan 20 20:33:04 2002 UTC revision 1.3 by kaz, Wed Jan 23 07:01:28 2002 UTC
# Line 54  down to the original one, or the value n Line 54  down to the original one, or the value n
54    (and (string= (first entry-one) (first entry-two))    (and (string= (first entry-one) (first entry-two))
55         (not (path-equal (second entry-one) (second entry-two)))))         (not (path-equal (second entry-one) (second entry-two)))))
56    
57  (defun mapping-sane-p (filemap)  (defun filemap-remove (filemap file-list)
58    "Returns a new filemap, with the specified files removed."
59      (mapcan #'(lambda (entry)
60                  (if (member (second entry) file-list :test #'path-equal)
61                    nil
62                    entry))))
63    
64    (defun filemap-rename-files (filemap file-list old-prefix new-prefix)
65    "Returns a new filemap, in which the pathames in the list file-list are edited
66    by replacing the old-prefix with the new-prefix. If any path thus created
67    matches an existing map entry, that map entry is removed. The sorting order
68    of the map is not preserved."
69      (let* ((op-len (length old-prefix))
70             (replace-map (mapcan #'(lambda (entry)
71                                      (destructuring-bind (object path) entry
72                                        (if (and (member path file-list
73                                                         :test #'path-equal)
74                                                 (path-prefix-equal old-prefix
75                                                                    path))
76                                          (list
77                                            (list object
78                                                  (format nil "~a~a"
79                                                          new-prefix
80                                                          (subseq path
81                                                                  op-len)))))))
82                                   filemap))
83             (delete-map (mapcan #'(lambda (entry)
84                                     (destructuring-bind (object path) entry
85                                       (if (member path file-list
86                                                   :test #'path-equal)
87                                         (list entry)))) filemap)))
88    
89        (append
90          (set-difference
91            (set-difference filemap delete-map :test #'filemap-same-path-p)
92            replace-map :test #'filemap-same-path-p)
93          replace-map)))
94    
95    (defun filemap-sane-p (filemap)
96  "Performs various integrity checks on a MCVS file map. Checks that  "Performs various integrity checks on a MCVS file map. Checks that
97  it's a list of lists, that all paths and object names are unique.  it's a list of lists, that all paths and object names are unique.
98  Returns T if checks pass otherwise NIL."  Returns T if checks pass otherwise NIL."

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.5