]> code.delx.au - gnu-emacs/blobdiff - admin/authors.el
* admin/authors.el (authors): First update the ChangeLog.
[gnu-emacs] / admin / authors.el
index f1aa2fa4428277237c931f452b40a10a88c8316b..b93c9b251ca231b4aa984748815ec93bd63eea14 100644 (file)
@@ -1361,24 +1361,36 @@ and changed by AUTHOR."
            (cons (list author wrote-list cowrote-list changed-list)
                  authors-author-list)))))
 
-(defun authors (root)
+(defun authors (root &optional nologupdate)
   "Extract author information from change logs and Lisp source files.
-ROOT is the root directory under which to find the files.  If called
-interactively, ROOT is read from the minibuffer.
-Result is a buffer *Authors* containing authorship information, and a
-buffer *Authors Errors* containing references to unknown files."
-  (interactive "DEmacs source directory: ")
+ROOT is the root directory under which to find the files.
+Interactively, read ROOT from the minibuffer.
+Accurate author information requires up-to-date change logs, so this
+first updates them, unless optional prefix argument NOLOGUPDATE is non-nil.
+The result is a buffer *Authors* containing authorship information,
+and a buffer *Authors Errors* containing references to unknown files."
+  (interactive "DEmacs source directory: \nP")
   (setq root (expand-file-name root))
+  (unless (file-exists-p (expand-file-name "src/emacs.c" root))
+    (unless (y-or-n-p
+             (format "Not the root directory of Emacs: %s, continue? " root))
+      (user-error "Not the root directory")))
+  ;; May contain your personal entries.
+  (or (not (file-exists-p (expand-file-name "ChangeLog" root)))
+      (y-or-n-p "Unversioned ChangeLog present, continue?")
+      (user-error "Unversioned ChangeLog may have irrelevant entries"))
+  (or nologupdate
+      ;; There are likely to be things that need fixing, so we update
+      ;; the versioned ChangeLog.N rather than the unversioned ChangeLog.
+      (zerop (call-process "make" nil nil nil
+                           "-C" root "change-history-nocommit"))
+      (error "Problem updating ChangeLog"))
   (let ((logs (process-lines find-program root "-name" "ChangeLog*"))
        (table (make-hash-table :test 'equal))
        (buffer-name "*Authors*")
        authors-checked-files-alist
        authors-invalid-file-names)
     (authors-add-fixed-entries table)
-    (unless (file-exists-p (expand-file-name "src/emacs.c" root))
-      (unless (y-or-n-p
-              (format "Not the root directory of Emacs: %s, continue? " root))
-       (error "Not the root directory")))
     (dolist (log logs)
       (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log)
        (message "Scanning %s..." log)