Changeset 9697


Ignore:
Timestamp:
Jun 8, 2008, 5:08:54 PM (11 years ago)
Author:
mikel
Message:

enabled updates from menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/ide-self-update.lisp

    r9696 r9697  
    105105
    106106;;; -----------------------------------------------------------------
    107 ;;; getting svn info
     107;;; running svn commands
    108108;;; -----------------------------------------------------------------
    109109
     
    111111  (with-output-to-string (out)
    112112     (run-program "svn" `("info" ,p) :output out)))
     113
     114(defmethod svn-update ((p string))
     115  (let ((result-status nil))
     116    (run-program "svn" `("update" ,p)
     117               :status-hook (lambda (ep)
     118                              (multiple-value-bind (status status-code)
     119                                  (external-process-status ep)
     120                                (when (eql status :exited)
     121                                  (setf result-status status-code)))))
     122    result-status))
     123
     124;;; -----------------------------------------------------------------
     125;;; parsing info
     126;;; -----------------------------------------------------------------
    113127
    114128(defmethod svn-info ((p pathname))
     
    207221    ((not (valid-directory-for-svn-update? directory))
    208222     (gui::alert-window :title "Update Failed"
    209                    :message (format nil
    210                                     "Subversion update failed. CCL directory '~A' doesn't exist, or lacks valid Subversion metadata."
    211                                     directory)))
     223                        :message (format nil
     224                                         "Subversion update failed. CCL directory '~A' is not a valid working copy."
     225                                         directory)))
    212226    ((not (valid-repository-for-svn-update? repository))
    213227     (gui::alert-window :title "Update Failed"
    214                    :message (format nil "Subversion update failed. The supplied repository URL is invalid: '~A'"
    215                                     repository)))
     228                        :message (format nil "Subversion update failed. The supplied repository URL is invalid: '~A'"
     229                                         repository)))
    216230    ((not (valid-revision-number-for-svn-update? last-revision))
    217231     (gui::alert-window :title "Update Failed"
    218                    :message (format nil "Subversion update failed. CCL found an invalid revision number for the current working copy: '~A'"
    219                                     last-revision)))
    220     (t (gui::alert-window :title "Update Succeeded"
    221                      :message "Subversion update succeeded. Soon we will actually run the update when it succeeds."))))
     232                        :message (format nil "Subversion update failed. CCL found an invalid revision number ('~A') for '~A'"
     233                                         last-revision directory)))
     234    (t (let ((status (svn-update directory)))
     235         (if (zerop status)
     236             (gui::alert-window :title "Update Succeeded"
     237                        :message (format nil "Subversion updated CCL source directory '~A'. CCL needs to be rebuilt."
     238                                         directory))
     239             (gui::alert-window :title "Update Failed"
     240                        :message (format nil "Subversion update of CCL directory '~A' failed with error code ~A."
     241                                         directory status)))))))
    222242
    223243(defun run-svn-update-for-directory (dir)
Note: See TracChangeset for help on using the changeset viewer.