* lisp/dvc-unified.el (dvc-send-commit-notification): Pass the current
  prefix arg, if one is provided.

* lisp/xgit-gnus.el (xgit-gnus-send-commit-notification): Take an
  optional argument that specifies the destination email address to use.
  Don't throw an error if no mapping is found.  Instead, use a blank
  destination address.
---
Committed revision c741afb2c01ebef2a325c6a0b147dc7bb105426f
to <git://git.hcoop.net/git/mwolson/emacs/dvc.git>.

 lisp/dvc-unified.el |    9 ++++++---
 lisp/xgit-gnus.el   |   31 +++++++++++++++++++------------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/lisp/dvc-unified.el b/lisp/dvc-unified.el
index 71147f9..2c42d09 100644
--- a/lisp/dvc-unified.el
+++ b/lisp/dvc-unified.el
@@ -532,9 +532,12 @@ branch to merge into the current database, branch, or 
workspace."
   (interactive))
 
 ;;;###autoload
-(define-dvc-unified-command dvc-send-commit-notification ()
-  "Send a commit notification for the changeset at point."
-  (interactive))
+(define-dvc-unified-command dvc-send-commit-notification (&optional to)
+  "Send a commit notification for the changeset at point.
+If TO is provided, send it to that email address.  If a prefix
+argument is given, modify the behavior of this command as
+specified by the VCS backend."
+  (interactive (list current-prefix-arg)))
 
 (provide 'dvc-unified)
 
diff --git a/lisp/xgit-gnus.el b/lisp/xgit-gnus.el
index d8a4b17..1ae1ffe 100644
--- a/lisp/xgit-gnus.el
+++ b/lisp/xgit-gnus.el
@@ -180,22 +180,29 @@ This is used by the `xgit-send-commit-notification' 
function."
   :type 'boolean
   :group 'dvc-xgit)
 
-(defun xgit-gnus-send-commit-notification ()
+(defun xgit-gnus-send-commit-notification (&optional to)
   "Send a commit notification email for the changelog entry at point.
 
 The option `xgit-mail-notification-destination' can be used to
-specify a prefix for the subject line.  The rest of the subject
-line contains the summary line of the commit.  Additionally, the
-destination email address can be specified."
-  (interactive)
+specify a prefix for the subject line, the destination email
+address, and an optional repo location.  The rest of the subject
+line contains the summary line of the commit.
+
+If the optional argument TO is provided, send an email to that
+address instead of consulting
+`xgit-mail-notification-destination'.  If the prefix
+argument (C-u) is given, then prompt for this value."
+  (interactive (list current-prefix-arg))
   (let (dest-specs)
-    (catch 'found
-      (dolist (m xgit-mail-notification-destination)
-        (when (string= default-directory (file-name-as-directory (car m)))
-          (setq dest-specs (cdr m))
-          (throw 'found t)))
-      (error (concat "Unable to find an matching entry in"
-                     " `xgit-mail-notification-destination'")))
+    (when (equal to '(4))
+      (setq to (read-string "Destination email address: ")))
+    (if to
+        (setq dest-specs (list nil to nil))
+      (catch 'found
+        (dolist (m xgit-mail-notification-destination)
+          (when (string= default-directory (file-name-as-directory (car m)))
+            (setq dest-specs (cdr m))
+            (throw 'found t)))))
     (let* ((rev (dvc-revlist-get-revision-at-point))
            (repo-location (nth 2 dest-specs)))
       (destructuring-bind (from subject body)
-- 
1.5.4.3


-- 
|       Michael Olson  |  FSF Associate Member #652     |
| http://mwolson.org/  |  Hobbies: Lisp, HCoop          |
| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
`-------------------------------------------------------'

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to