Changeset 51


Ignore:
Timestamp:
10/06/06 19:55:15 (19 years ago)
Author:
Magnus Henoch
Message:

Add functions for keeping a pristine. Use it when getting and pulling.

Location:
cl-darcs/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified cl-darcs/trunk/get.lisp

    r35 r51  
    6565          (append-inventory outname patchinfo)
    6666          (format t ".")))
     67      (format t "~&Creating pristine")
     68      (create-pristine-from-tree outname)
    6769      (format t "~&All done"))))
    6870
  • TabularUnified cl-darcs/trunk/pull.lisp

    r38 r51  
    5050                                                            :patches our-patches)))))
    5151        (format t "~&Applying patches")
    52         (dolist (p merged-patches)
    53           (apply-patch p ourrepo)
    54           ;; If this is not a named patch, our assumptions are
    55           ;; challenged.
    56           (append-inventory ourrepo (named-patch-patchinfo p))
    57           (write-patch-to-repo p ourrepo)
    58           (format t ".")))))
    59   (format t "~&All done"))
     52        (let ((applying-to-source t)
     53              (source-and-pristine-differ nil))
     54          (dolist (p merged-patches)
     55            ;; First, copy the modified patch to the repository.
     56            (write-patch-to-repo p ourrepo)
     57            ;; Then, apply it to the pristine copy.  This couldn't
     58            ;; possibly fail.
     59            (apply-patch-to-pristine p ourrepo)
     60            ;; Note the patch in the inventory.
     61            (append-inventory ourrepo (named-patch-patchinfo p))
     62            ;; And finally apply the patch to the real source.  This
     63            ;; could fail if the source has been modified.  Deal with
     64            ;; that in a crude way.  XXX: it is wasteful to apply
     65            ;; patches twice.
     66            (when applying-to-source
     67              (restart-case
     68                  (apply-patch p ourrepo)
     69                (skip-this ()
     70                    :report "Don't apply this patch to the source tree (it was applied to the pristine tree)"
     71                    (setf source-and-pristine-differ t))
     72                (skip-all ()
     73                    :report "Stop trying to apply patches to the source tree (they will be applied to the pristine tree)"
     74                    (setf source-and-pristine-differ t)
     75                    (setf applying-to-source nil))))
     76            (format t "."))
     77          (when source-and-pristine-differ
     78            (format t "~&~<Some patches could not be applied to the source tree.~
     79You should manually merge changes from the pristine tree in _darcs/pristine/.~:@>")))))
     80    (format t "~&All done")))
Note: See TracChangeset for help on using the changeset viewer.