;ELC ;;; Compiled by mwolson@grepfind.mwolson.org on Thu Jan 24 00:15:29 2008 ;;; from file /stuff/proj/emacs/dvc/mwolson/lisp/bzr-submit.el ;;; in Emacs version 23.0.50.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`bzr-submit.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\207" [require bzr-core bzr diff-mode custom-declare-group dvc-bzr-submit nil "Submitting and applying patches via email for bzr." :group dvc :prefix "bzr-submit-"] 8) #@219 *Project in which patches should be applied. An alist of rules to map branch nicknames to target directories. This is used by the `bzr-gnus-apply-patch' function. Example setting: '(("dvc-dev-bzr" "~/work/bzr/dvc")) (custom-declare-variable 'bzr-apply-patch-mapping 'nil '(#$ . -852) :type '(repeat (list :tag "Rule" (string :tag "Branch nickname") (string :tag "Target directory"))) :group 'dvc-bzr-submit) #@222 *Email addresses that should be used to send patches. An alist of rules to map branch nicknames to target email addresses and the base name to use in the attached patch. This is used by the `bzr-submit-patch' function. (custom-declare-variable 'bzr-submit-patch-mapping ''(("dvc-dev-bzr" ("dvc-dev@gna.org" "dvc"))) '(#$ . -1269) :type '(repeat (list :tag "Rule" (string :tag "Branch nickname") (list :tag "Target" (string :tag "Email address") (string :tag "Base name of patch")))) :group 'dvc-bzr-submit) #@130 *What shall be done, after sending a patch via mail. The possible values are 'keep-patch, 'keep-changes, 'keep-both, 'keep-none. (custom-declare-variable 'bzr-patch-sent-action ''keep-both '(#$ . -1785) :type '(choice (const keep-patch) (const keep-changes) (const keep-both) (const keep-none)) :group 'dvc-bzr-submit) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list bzr-patch-data default-boundp set-default nil] 3) #@132 Retrieve a list of files in the current repo that have changed. If INCLUDE-ADDED is specified, include files that are newly-added. (defalias 'bzr-changed-files #[(&optional include-added) "\302 \303\304\305\306C\307\310\311\312\313\314\315\316\317\320\303D\257E\321\322&\210*\207" [files default-directory bzr-tree-root nil dvc-run-dvc-sync bzr "status" :finished lambda (output error status arguments) apply #[(output error status arguments) "q\210eb\210 \203'\303\304\305\306#\203'\307y\210\310\311!\203'\312\307!\nB\307y\210\202eb\210\303\313\305\306#\205G\307y\210\310\311!\205G\312\307!\nB\307y\210\2025\207" [output include-added files re-search-forward "^added:" nil t 1 looking-at "^ \\([^ ].*\\)$" match-string "^modified:"] 4] output error status arguments quote :error #[(output error status arguments) "\300\301!\207" [error "An error occurred"] 2]] 14 (#$ . 2242)]) #@52 Read several string ITEMS from list, using PROMPT. (defalias 'dvc-read-several-from-list #[(prompt items) "\305\306\307\"\305\n\2031\310\f\n\305\311$\211\2031 ;\2031 \312\230\2041 B\313 C\n\"\211\204 +\207" [items item table chosen prompt nil mapcar list dvc-completing-read t "" delete] 6 (#$ . 3144)]) #@59 Display the diff contained in FILE with DVC font-locking. (defalias 'bzr-show-diff-from-file #[(file) "\305\306!\307\216rq\210\310 !\210\311\312\211\313\312\314%p\f\203 \315 !\210\316\n\317 #-\207" [#1=#:temp-buffer file output buffer dvc-switch-to-buffer-first generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents-literally dvc-prepare-changes-buffer nil diff bzr dvc-switch-to-buffer dvc-show-changes-buffer bzr-parse-diff] 6 (#$ . 3468)]) #@357 Run "bzr diff" to create a .diff file. The changes are stored in the patch file 'FILE-NAME.diff'. INCLUDED-FILES lists the files whose changes will be included. If this is nil, include changes to all files. PROMPT-FILES indicates whether to prompt for the files to include in the patch. This is only heeded when the function is not called interactively. (defalias 'bzr-changes-save-as-patch #[(file-name &optional included-files prompt-files) "t\204\203\306\307\310\311!\"\312\n!\313P\314 \311\315\316\317C \244\320\321\322\323\324\325\326\327\330\331\332\333\334D\257E&+\207" [prompt-files included-files file-name continue default-directory patch-file-name dvc-read-several-from-list "Files to include (all by default, RET ends): " bzr-changed-files t expand-file-name ".diff" bzr-tree-root dvc-run-dvc-sync bzr "diff" :finished #[(output error status arguments) "\300\301!\207" [message "No changes occurred"] 2] :error lambda (output error status arguments) apply #[(output error status arguments) "q\210\302 !\207" [output patch-file-name write-file] 2] output error status arguments quote nil] 16 (#$ . 4000) (list (read-file-name (concat "File to store the patch in " "(without an extension): ") nil "") (dvc-read-several-from-list "Files to include (all by default, RET ends): " (bzr-changed-files t)))]) #@79 Undo the changes contained in FILE to the bzr project whose root is ROOT-DIR. (defalias 'bzr-undo-diff-from-file #[(file root-dir) "\306\307!\310\216rq\210\311 !\210\312 \210eb\210\n\313\314 \313\315#\205(\313\316\317\217\210\202-\207" [#1=#:temp-buffer file root-dir diff-advance-after-apply-hunk default-directory diff-file-header-re generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents-literally diff-mode nil re-search-forward t (byte-code "\301\302!\210\303\304\302#\204\304\207" [diff-hunk-header-re diff-apply-hunk t re-search-forward nil] 4) ((error))] 4 (#$ . 5333)]) #@652 Submit a patch to a bzr working copy (at BZR-TREE-ROOT) via email. With this feature it is not necessary to branch a bzr archive. You simply edit your checked out copy from your project and call this function. The function will create a patch as a .diff file (based on PATCH-BASE-NAME) and send it to the given email address EMAIL. VERSION-STRING should indicate the version of bzr that the patch applies to. DESCRIPTION is a brief descsription of the patch. SUBJECT is the subject for the email message. PROMPT-FILES indicates whether to prompt for the files to include in the patch. For an example, how to use this function see: `bzr-submit-patch'. (defalias 'bzr-prepare-patch-submission #[(bzr-tree-root patch-base-name email version-string &optional description subject prompt-files) "\306\307\"\306 \n\"\211\310P\311\n!\204\312\n!\210\313\f\314#\210\315\316!\210\317 \210\320\314\211\211\211&\210\321\322!\210  E\323 \324\261\210!c\210db\210\325 \326\"\210\327 !\210\330\331!\210eb\210\332\333!\210\"\206f\334c,\207" [bzr-tree-root default-directory patch-directory patch-base-name patch-full-base-name patch-full-name expand-file-name ".tmp-dvc/" ".diff" file-exists-p make-directory bzr-changes-save-as-patch nil require reporter delete-other-windows reporter-submit-bug-report make-local-variable bzr-patch-data "[VERSION] " "\n\n" mml-attach-file "text/x-patch" bzr-show-diff-from-file other-window 1 mail-position-on-field "Subject" "[PATCH] " prompt-files email description version-string bzr-command-version subject] 8 (#$ . 6005) nil]) #@208 Clean up after sending a patch via mail. That function is usually called via `message-sent-hook'. Its purpose is to revert the sent changes or to delete sent changeset patch (see: `bzr-patch-sent-action'). (defalias 'bzr-submit-patch-done #[nil "\205F \303>\203\304\305@\"\210\306@\211A@)\"\210 \307>\2036\304\310\211AA)@\"\210\311\211AA)@!\210 \312>\205F\304\313\211AA)@\"\207" [bzr-patch-data bzr-patch-sent-action x (keep-patch keep-none) message "Reverting the sent changes in %s" bzr-undo-diff-from-file (keep-changes keep-none) "Deleting the sent patch %s" delete-file (keep-both) "Keeping the sent changes and the sent patch %s"] 4 (#$ . 7585)]) (add-hook 'message-sent-hook 'bzr-submit-patch-done) #@465 Submit a patch for the current bzr project. With this feature it is not necessary to tag an arch archive. You simply edit your checked out copy and call this function. The function will create a patch as *.tar.gz file and prepare a buffer to send the patch via email. The variable `bzr-submit-patch-mapping' allows to specify the target email address and the base name of the sent tarball. After the user has sent the message, `bzr-submit-patch-done' is called. (defalias 'bzr-submit-patch #[nil "\306 \210\307 \310 \"\211A@)\211@\206\311 A@\206\312\313\314\315 ! \316\317\320\321 \"Q\f\322t&,\207" [tree-id bzr-submit-patch-mapping x submit-patch-info mail-address patch-base-file-name bzr-command-version bzr-tree-id assoc "" "bzr" bzr-prepare-patch-submission dvc-uniquify-file-name bzr-tree-root "-patch-" format-time-string "%Y-%m-%d_%H-%M-%S" current-time nil dvc-patch-email-message-body-template] 9 (#$ . 8315) nil]) (provide 'bzr-submit)