[Update darcsum clinton@unknownlamer.org**20070818161927] { hunk ./site-lisp/darcsum.el 71 -;; - Interface to darcs changes / darcs unrecord / darcs amend +;; - Interface to darcs unrecord hunk ./site-lisp/darcsum.el 684 - "DARCS_DONT_COLOR=1") + "DARCS_DONT_COLOR=1" + "DARCS_DONT_ESCAPE_TRAILING_CR=1") hunk ./site-lisp/darcsum.el 717 - ((looking-at "\n*Finished recording patch") + ((looking-at "\n*Finished \\(recording\\|amending\\) patch") hunk ./site-lisp/darcsum.el 720 - (delete-file darcsum-logfile) + (when darcsum-logfile (delete-file darcsum-logfile)) hunk ./site-lisp/darcsum.el 722 - ((looking-at "\n*Ok, if you don't want to record anything") + ((looking-at "\n*Ok, if you don't want to \\(record\\|amend\\) anything") hunk ./site-lisp/darcsum.el 724 - (delete-file darcsum-logfile) + (when darcsum-logfile (delete-file darcsum-logfile)) hunk ./site-lisp/darcsum.el 737 - ((looking-at "\n*Do you really want to .+\\? ") + ((looking-at "\n*Do you really want to .+\\? ") ;; Should the last whitespace be there? hunk ./site-lisp/darcsum.el 758 + ((looking-at "\\(.*\n\\)*Shall I amend this patch\\?.*") + (process-send-string proc "y") + (delete-region (point-min) (match-end 0))) + hunk ./site-lisp/darcsum.el 789 - "^Shall I \\(record\\|send\\|revert\\) this \\(patch\\|change\\)\\?.+[]:] ") + "^Shall I \\(record\\|send\\|revert\\|add\\) this \\(patch\\|change\\)\\?.+[]:] ") hunk ./site-lisp/darcsum.el 849 -C-c C-c to record."))) +C-c C-c to record.") + (run-hooks 'darcsum-comment-hook))) hunk ./site-lisp/darcsum.el 862 +(defun darcsum-changes (&optional how-many) + "Show the changes in another buffer" + (interactive "P") + (let ((proc (darcsum-start-process + "changes" (if how-many + (list "--last" (number-to-string how-many)) + (list)) + 'darcsum-parent-buffer (current-buffer)))) + (set-process-filter proc nil) + (set-process-sentinel proc 'darcsum-changes-sentinel) + (switch-to-buffer-other-window (process-buffer proc)) + (process-buffer proc))) + +(defun darcsum-changes-sentinel(process event) + (with-current-buffer (process-buffer process) + (goto-char (point-min)))) + +(defun darcsum-amend () + "Amend last patch with selected changeset." + (interactive) + (let ((changeset (darcsum-selected-changeset t)) + (parent-buffer (current-buffer))) + (if (> (length changeset) 0) + (let ((history-buffer (darcsum-changes 1))) + (with-current-buffer history-buffer + (save-excursion + (goto-char (point-max)) + (insert " +WARNINGS: You should ONLY use amend-record on patches which only exist in a single repository! +Also, running amend-record while another user is pulling from the same repository may cause repository corruption.")) + (sleep-for 2) + (goto-char (point-min))) + (setq amend (yes-or-no-p "Amend this latest changeset? (see WARNINGS) ")) + (kill-buffer history-buffer) + (when amend + (darcsum-start-process + "amend" (list) + 'darcsum-logfile nil + 'darcsum-changeset-to-record changeset + 'darcsum-parent-buffer parent-buffer))) + (message "You need to select something first")))) + hunk ./site-lisp/darcsum.el 1291 - (ediff (darcsum-original-path (point)) - (darcsum-path (point))))))) + (let ( (pristine-filename (darcsum-original-path (point))) + (working-filename (darcsum-path (point))) + (old-window-configuration (current-window-configuration)) ;;Save the current window configuration, before opening ediff + ) + (progn + (save-excursion + (find-file-read-only pristine-filename) ;;Pristine copy should not be modified + (rename-buffer (concat "*darcsum-pristine:" pristine-filename "*")) ;;It should be clear this is not a buffer you want to touch. + ) + (ediff pristine-filename working-filename + ;;Add this anonymous function as a startup hook in ediff-mode + (lambda () (progn + (make-variable-buffer-local 'pre-darcsum-ediff-window-configuration) ;;make buffer-local variable storing old window configuration, since "let" bindings die before ediff buffers are killed + (setq pre-darcsum-ediff-window-configuration old-window-configuration) + (make-local-hook 'ediff-quit-hook) ;;After we quit THIS PARTICULAR ediff buffer, restore the old window configuration + (add-hook 'ediff-quit-hook (lambda () (set-window-configuration pre-darcsum-ediff-window-configuration))) + ))) + )))))) hunk ./site-lisp/darcsum.el 1479 + ["Amend last changeset" darcsum-amend t] ; fixme: condition hunk ./site-lisp/darcsum.el 1576 - (let* ((process-environment (cons "DARCS_DONT_ESCAPE_TRAILING_SPACES=1" - (cons "DARCS_DONT_COLOR=1" - process-environment))) + (let* ((process-environment (append + (list "DARCS_DONT_ESCAPE_TRAILING_SPACES=1" + "DARCS_DONT_COLOR=1" + "DARCS_DONT_ESCAPE_TRAILING_CR=1") + process-environment)) }