/[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.18 by kaz, Tue Feb 5 03:19:03 2002 UTC revision 1.19 by kaz, Fri Feb 8 06:51:45 2002 UTC
# Line 171  to ensure that the newly incorporated ch Line 171  to ensure that the newly incorporated ch
171          (destructuring-bind (left right) item          (destructuring-bind (left right) item
172            (case (synchronize-files left right)            (case (synchronize-files left right)
173              ((:left)              ((:left)
174                (chatter-info "synchronizing ~a -> ~a~%" left right))                (chatter-info "sync ~a -> ~a~%" left right))
175              ((:right)              ((:right)
176                (chatter-info "synchronizing ~a <- ~a~%" left right))                (chatter-info "sync ~a <- ~a~%" left right))
177              ((:same))              ((:same))
178                ((:dir)
179                  (error "mcvs-sync: cannot sync, either ~a or ~a is a directory."
180                         left right))
181              ((nil)              ((nil)
182                (error "mcvs-sync: neither ~a nor ~a exists."                (error "mcvs-sync: neither ~a nor ~a exists."
183                       left right))))))))                       left right))))))))
# Line 214  mapping and repository mapping, respecti Line 217  mapping and repository mapping, respecti
217  between them and then reorganizes the file structure of the sandbox as  between them and then reorganizes the file structure of the sandbox as
218  necessary to make the mapping up to date. Then the local mapping file is  necessary to make the mapping up to date. Then the local mapping file is
219  overwritten so it is identical to the repository one.  This is necessary to  overwritten so it is identical to the repository one.  This is necessary to
220  bring the local structure up to date after after CVS updates, adds or removes."  bring the local structure up to date after incorporating mapping changes
221    whether they came from the CVS repository, or from local operations."
222  *mcvs-map-local* *mcvs-map*)  *mcvs-map-local* *mcvs-map*)
223    (let ((old-filemap (mapping-read *mcvs-map-local*))    (let ((old-filemap (mapping-read *mcvs-map-local*))
224          (new-filemap (mapping-read *mcvs-map* :sanity-check t)))          (new-filemap (mapping-read *mcvs-map* :sanity-check t)))
225      (multiple-value-bind (added-items removed-items moved-pairs)      (multiple-value-bind (added-items removed-items moved-pairs)
226                           (mapping-difference old-filemap new-filemap)                           (mapping-difference old-filemap new-filemap)
227          ;; Sanity checks
228          (dolist (item added-items)
229            (let ((file-info (exists (second item))))
230              (when (and file-info
231                         (not (same-file-p file-info (stat (first item))))
232                         (not (mapping-lookup old-filemap (second item))))
233                (error "mcvs: cannot add ~a, a local file is in the way."
234                       (second item)))))
235    
236          (dolist (item moved-pairs)
237            (destructuring-bind (old-item new-item) item
238              (let ((file-info (exists (second new-item))))
239                (when (and file-info
240                           (not (mapping-lookup old-filemap (second new-item))))
241                  (error "mcvs: cannot move ~a -> ~a, a local file is in the way."
242                         (second old-item) (second new-item))))))
243    
244          ;; Actual restructuring
245        (dolist (item removed-items)        (dolist (item removed-items)
246          (can-restart-here ("Continue updating file structure.")          (can-restart-here ("Continue updating file structure.")
247            (ensure-directories-gone (second item))            (chatter-info "deleting ~a~%" (second item))
248            (chatter-info "deleting ~a~%" (second item))))            (ensure-directories-gone (second item))))
249    
250        (dolist (item moved-pairs)        (dolist (item moved-pairs)
251          (destructuring-bind (old-item new-item) item          (destructuring-bind (old-item new-item) item
252            (can-restart-here ("Continue updating file structure.")            (can-restart-here ("Continue updating file structure.")
253                (chatter-info "moving ~a -> ~a~%" (second old-item)
254                                                  (second new-item))
255              (ensure-directories-gone (second old-item))              (ensure-directories-gone (second old-item))
             (ensure-directories-exist (second new-item))  
256              (no-existence-error (unlink (second new-item)))              (no-existence-error (unlink (second new-item)))
257              (synchronize-files (first new-item) (second new-item))              (synchronize-files (first new-item) (second new-item)))))
             (chatter-info "moving ~a -> ~a~%" (second old-item)  
                                               (second new-item)))))  
258    
259        (dolist (item added-items)        (dolist (item added-items)
260          (can-restart-here ("Continue updating file structure.")          (can-restart-here ("Continue updating file structure.")
261            (synchronize-files (first item) (second item))            (chatter-info "adding ~a~%" (second item))
262            (chatter-info "adding ~a~%" (second item)))))            (synchronize-files (first item) (second item)))))
263    
264      (mapping-write new-filemap *mcvs-map-local*)))      (mapping-write new-filemap *mcvs-map-local*)))

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.5