ViewVC logotype

Contents of /meta-cvs/F-205A90D152A06EE04D552B256CDAF850

Parent Directory Parent Directory | Revision Log Revision Log

Revision - (show annotations)
Sun Apr 13 06:22:43 2003 UTC (11 years ago) by kaz
Branch: mcvs-1-0-branch
CVS Tags: mcvs-1-0-6
Changes since +4 -2 lines
Revamped the synchronization logic. Synchronization now happens
in a specific direction.  For example, if we are doing a diff,
we just need to push changes from the tree to the MCVS directory,
not the other way around. Or: before an update or commit, we push from
the tree to MCVS, then after the update, in the other direction.

* code/update.lisp (mcvs-update): The before update is done
in the :left direction only, and the after update in the :right.

* code/move.lisp (mcvs-move): The just-in-case sync is done
in the :left direction only.

* code/link.lisp (mcvs-link): Likewise.

* code/remove.lisp (mcvs-remove): Likewise.

* code/add.lisp (mcvs-add): Get rid of mapping-synchronize call;
it's completely unnecessary, since the new files are not even
in the MAP-LOCAL, and the add logic explicitly links them into
the MCVS directory.

* code/generic.lisp (mcvs-generic): New keyword parameter,
need-sync-before. Before-synchronization done in :left direction,
after-synchronization in :right direction. Before-synchronization
is now not done by default; need-sync-before must be specified.
(mcvs-commit-wrapper): Specify before and after sync.
(mcvs-diff-wrapper, mcvs-status-wrapper,
mcvs-edit-wrapper): Explicitly specify before sync.
(mcvs-tag-wrapper, mcvs-annotate-wrapper): Implicitly specify no sync.
(mcvs-unedit-wrapper): Add before sync.

* code/sync.lisp (synchronize-files):  New key parameter :direction,
values can be :left, :right or :either. Default is :either.
If the value is :left or :right, then a sync is done only in that
direction, otherwise the value :no-sync is returned.
Behavior change: if the left file is missing (F- file in MCVS
directory) it is not re-created, but rather :no-sync is returned.
Also, if both files exist, have the same timestamp, and are
distinct objects, if the direction is :left or :right, then
the appropriate restart is automatically chosen. So this will
do the right thing on filesystems where link() is performed by
copying, without bothering the user with the error.

* code/mapping.lisp (mapping-synchronize): New :direction key
parameter, passed down to synchronize-filed. The new :no-sync
return value from synchronize-files is handled.
(mapping-update): Select the :right direction for synchronizing
moves, adds or rollbacks.
1 ;;; This source file is part of the Meta-CVS program,
2 ;;; which is distributed under the GNU license.
3 ;;; Copyright 2002 Kaz Kylheku
5 (require "dirwalk")
6 (require "chatter")
7 (require "mapping")
8 (require "options")
9 (require "generic")
10 (provide "update")
12 (defun mcvs-update (&optional cvs-options cvs-update-options files)
13 (let ((need-sync (not (find "p" cvs-update-options
14 :key #'first :test #'string=))))
15 (if (or files *metaonly-option* *nometa-option*)
16 (mcvs-generic "update" cvs-options cvs-update-options nil
17 files :need-sync-after need-sync
18 :need-update-after t
19 :default-include-meta-files nil)
20 (in-sandbox-root-dir
21 (if need-sync
22 (progn
23 ;; Push changes in tree to CVS sandbox, so they can be merged
24 ;; with stuff coming from repository.
25 (chatter-debug "Synchronizing.~%")
26 (mapping-synchronize :direction :left)
28 (current-dir-restore
29 (chdir *mcvs-dir*)
30 (super-restart-case
31 (progn
32 (chatter-debug "Invoking CVS.~%")
33 (unless (execute-program `("cvs" ,@(format-opt cvs-options)
34 "up" ,@(format-opt
35 cvs-update-options)))
36 (error "CVS update failed.")))
37 (continue ()
38 :report "Update file structure and re-synchronize."
39 (unwind))
40 (retry ()
41 :report "Try invoking CVS again."
42 (retry))))
44 (chatter-debug "Updating file structure.~%")
45 (mapping-update)
46 (chatter-debug "Synchronizing again.~%")
47 (mapping-synchronize :direction :right))
48 (current-dir-restore
49 (chdir *mcvs-dir*)
50 (chatter-debug "Invoking CVS.~%")
51 (unless (execute-program `("cvs" ,@(format-opt cvs-options)
52 "up" ,@(format-opt cvs-update-options))))
53 (error "CVS update failed."))))))
54 (values))
56 (defun mcvs-update-wrapper (cvs-options cvs-command-options mcvs-args)
57 (mcvs-update cvs-options cvs-command-options mcvs-args))

  ViewVC Help
Powered by ViewVC 1.1.5