]> code.delx.au - gnu-emacs-elpa/commitdiff
Handle blocked bugs in debbugs
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 5 Feb 2015 08:38:20 +0000 (09:38 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 5 Feb 2015 08:38:20 +0000 (09:38 +0100)
* debbugs-gnu.el (debbugs-gnu-mode-map): Add keys "b" and "B".
(debbugs-gnu-show-blocked-by-reports)
(debbugs-gnu-show-blocking-reports): New defuns.
(debbugs-gnu-send-control-message): Implement "unmerge", "block"
and "unblock".

* debbugs.el (debbugs-get-status): Handle also `blocks' and `blockedby.

packages/debbugs/Debbugs.wsdl
packages/debbugs/debbugs-gnu.el
packages/debbugs/debbugs-org.el
packages/debbugs/debbugs.el
packages/debbugs/debbugs.texi

index b186c807ed694da439403a9d7876a0c312f92e31..427a381a77034e540d6a6a8b8bdc2907d4b54f7d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- Copyright (C) 2011-2014  Free Software Foundation, Inc.
+<!-- Copyright (C) 2011-2015  Free Software Foundation, Inc.
 
 This file is not part of GNU Emacs.
 
index 3fe88ca0abd500833943edc64002b9f048d3505f..97c67e4b33cc6d71cc13d2c6ec789bf8233fefc0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; debbugs-gnu.el --- interface for the GNU bug tracker
 
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Michael Albinus <michael.albinus@gmx.org>
@@ -92,6 +92,8 @@
 ;;   RET: Show corresponding messages in Gnus
 ;;   "C": Send a control message
 ;;   "t": Mark the bug locally as tagged
+;;   "b": Show bugs this bug is blocked by
+;;   "B": Show bugs this bug is blocking
 ;;   "d": Show bug attributes
 
 ;; Furthermore, you could apply the global actions
@@ -791,6 +793,8 @@ Used instead of `tabulated-list-print-entry'."
     (define-key map "x" 'debbugs-gnu-toggle-suppress)
     (define-key map "/" 'debbugs-gnu-narrow-to-status)
     (define-key map "w" 'debbugs-gnu-widen)
+    (define-key map "b" 'debbugs-gnu-show-blocked-by-reports)
+    (define-key map "B" 'debbugs-gnu-show-blocking-reports)
     (define-key map "C" 'debbugs-gnu-send-control-message)
     map))
 
@@ -926,6 +930,24 @@ The following commands are available:
     (when id
       (debbugs-gnu-goto id))))
 
+(defun debbugs-gnu-show-blocked-by-reports ()
+  "Display all bug reports this report is blocked by."
+  (interactive)
+  (let ((id (debbugs-gnu-current-id))
+       (status (debbugs-gnu-current-status)))
+    (if (null (cdr (assq 'blockedby status)))
+       (message "Bug %d is not blocked by any other bug" id)
+      (apply 'debbugs-gnu-bugs (cdr (assq 'blockedby status))))))
+
+(defun debbugs-gnu-show-blocking-reports ()
+  "Display all bug reports this report is blocking."
+  (interactive)
+  (let ((id (debbugs-gnu-current-id))
+       (status (debbugs-gnu-current-status)))
+    (if (null (cdr (assq 'blocks status)))
+       (message "Bug %d is not blocking any other bug" id)
+      (apply 'debbugs-gnu-bugs (cdr (assq 'blocks status))))))
+
 (defun debbugs-gnu-narrow-to-status (string &optional status-only)
   "Only display the bugs matching STRING.
 If STATUS-ONLY (the prefix), ignore matches in the From and
@@ -1104,8 +1126,9 @@ removed instead."
          "Control message: "
          '("serious" "important" "normal" "minor" "wishlist"
            "done" "donenotabug" "donewontfix" "doneunreproducible"
-           "unarchive" "reopen" "close"
+           "unarchive" "unmerge" "reopen" "close"
            "merge" "forcemerge"
+           "block" "unblock"
            "owner" "noowner"
            "invalid"
            "reassign"
@@ -1134,18 +1157,31 @@ removed instead."
               (format "%s.%s"
                       (match-string 1 emacs-version)
                       (match-string 2 emacs-version)))
-             (t emacs-version))))))
+             (t emacs-version)))))
+        (status (debbugs-gnu-current-status)))
     (with-temp-buffer
       (insert "To: control@debbugs.gnu.org\n"
              "From: " (message-make-from) "\n"
              (format "Subject: control message for bug #%d\n" id)
              "\n"
              (cond
-              ((member message '("unarchive" "reopen" "noowner"))
+              ((member message '("unarchive" "unmerge" "reopen" "noowner"))
                (format "%s %d\n" message id))
               ((member message '("merge" "forcemerge"))
                (format "%s %d %s\n" message id
                        (read-string "Merge with bug #: ")))
+              ((member message '("block" "unblock"))
+               (format
+                "%s %d by %s\n" message id
+                (mapconcat
+                 'identity
+                 (completing-read-multiple
+                  (format "%s with bug(s) #: " (capitalize message))
+                  (if (equal message "unblock")
+                      (mapcar 'number-to-string
+                              (cdr (assq 'blockedby status))))
+                  nil (and (equal message "unblock") status))
+                 " ")))
               ((equal message "owner")
                (format "owner %d !\n" id))
               ((equal message "reassign")
index 8a98aec09511b334dc79bca147ca2033dac1068d..d49219ff191cbc1b9cf7199e8ed7d6409ac95bc4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; debbugs-org.el --- Org-mode interface for the GNU bug tracker
 
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.org>
 ;; Keywords: comm, hypermedia, maint, outlines
index 725a394f9b5b20edffb9c704f704047fd2c47c3f..35caf8397f356fcd8ffe5543e52e918976a129d7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; debbugs.el --- SOAP library to access debbugs servers
 
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hypermedia
@@ -309,10 +309,13 @@ Example:
             (setcdr y (mapcar
                        (lambda (z) (if (numberp z) (number-to-string z) z))
                        (cdr y))))
-          ;; "mergedwith" is a string, containing blank separated bug numbers.
-          (setq y (assoc 'mergedwith (cdr (assoc 'value x))))
-          (when (stringp (cdr y))
-            (setcdr y (mapcar 'string-to-number (split-string (cdr y) " " t))))
+          ;; "mergedwith", "blocks" and "blockedby are strings,
+          ;; containing blank separated bug numbers.
+          (dolist (attribute '(mergedwith blocks blockedby))
+            (setq y (assoc attribute (cdr (assoc 'value x))))
+            (when (stringp (cdr y))
+              (setcdr y (mapcar
+                         'string-to-number (split-string (cdr y) " " t)))))
           ;; "package" is a string, containing comma separated
           ;; package names.  "keywords" and "tags" are strings,
           ;; containing blank separated package names.
index 8c70e26ad7bd77ac1acfd446f2bef4caa7994379..c26717a334eae9df53939726c4eb3a96d11df61d 100644 (file)
@@ -8,7 +8,7 @@
 @end direntry
 
 @copying
-Copyright @copyright{} 2011-2014 Free Software Foundation, Inc.
+Copyright @copyright{} 2011-2015 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document