From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#8054: 24.0.50; Who ever heard of a version number that doesn't change all year? Date: Mon, 21 Nov 2011 19:48:16 -0500 Message-ID: References: <87hbc4f8c2.fsf@jidanni.org> <87vd0fvfi5.fsf@stupidchicken.com> <87mxlrvf2p.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1321922936 12176 80.91.229.12 (22 Nov 2011 00:48:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2011 00:48:56 +0000 (UTC) To: 8054@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 01:48:49 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSeXZ-0003jA-Ca for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2011 01:48:49 +0100 Original-Received: from localhost ([::1]:53234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSeXY-0003Aq-UB for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Nov 2011 19:48:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSeXW-0003Ab-JQ for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2011 19:48:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSeXV-0006eL-Hl for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2011 19:48:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSeXV-0006eH-Fy for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2011 19:48:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RSeYj-0007S4-QH for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2011 19:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2011 00:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8054 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8054-submit@debbugs.gnu.org id=B8054.132192297728593 (code B ref 8054); Tue, 22 Nov 2011 00:50:01 +0000 Original-Received: (at 8054) by debbugs.gnu.org; 22 Nov 2011 00:49:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RSeYL-0007R8-6U for submit@debbugs.gnu.org; Mon, 21 Nov 2011 19:49:37 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RSeYI-0007R0-1o for 8054@debbugs.gnu.org; Mon, 21 Nov 2011 19:49:35 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RSeX2-0002xj-Mf; Mon, 21 Nov 2011 19:48:16 -0500 X-Spook: Aldergrove SSL IMF AUTODIN enigma diwn e-bomb doctrine X-Ran: ]\]YrN+xHh$fftVm4FU^U3O*'-Eq|luh&z0$fFC0BS1q-b;,[z`P5_F",OyJ")Y\ (Chong Yidong's message of "Sat, 19 Feb 2011 17:23:42 -0500") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 21 Nov 2011 19:50:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:54145 Archived-At: Here's a patch to define an `emacs-bzr-version' during dumping and include it in bug reports. === modified file 'lisp/loadup.el' *** lisp/loadup.el 2011-07-06 22:43:48 +0000 --- lisp/loadup.el 2011-11-22 00:44:13 +0000 *************** *** 259,264 **** --- 259,266 ---- (versions (mapcar (function (lambda (name) (string-to-number (substring name (length base))))) files))) + (setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version) + (error nil))) ;; `emacs-version' is a constant, so we shouldn't change it with `setq'. (defconst emacs-version (format "%s.%d" === modified file 'lisp/mail/emacsbug.el' *** lisp/mail/emacsbug.el 2011-09-23 23:47:27 +0000 --- lisp/mail/emacsbug.el 2011-11-22 00:25:12 +0000 *************** *** 224,229 **** --- 224,231 ---- (add-text-properties (1+ user-point) (point) prompt-properties) (insert "\n\nIn " (emacs-version) "\n") + (if (stringp emacs-bzr-version) + (insert "Bzr revision: " emacs-bzr-version "\n")) (if (fboundp 'x-server-vendor) (condition-case nil ;; This is used not only for X11 but also W32 and others. === modified file 'lisp/version.el' *** lisp/version.el 2011-03-12 19:19:47 +0000 --- lisp/version.el 2011-11-22 00:37:43 +0000 *************** *** 78,89 **** --- 78,110 ---- ;; We hope that this alias is easier for people to find. (defalias 'version 'emacs-version) + ;; Set during dumping, this is a defvar so that it can be setq'd. + (defvar emacs-bzr-version nil + "String giving the bzr revision number from which this Emacs was built. + This is nil if Emacs was not built from a bzr checkout, or if we could + not determine the revision.") + + (defun emacs-bzr-get-version () + "Try to return as a string the bzr revision number of the Emacs sources. + Returns nil if the sources do not seem to be under bzr, or if we could + not determine the revision. Note that this reports on the current state + of the sources, which may not correspond to the running Emacs." + (let ((file (expand-file-name ".bzr/branch/last-revision" source-directory))) + (if (file-readable-p file) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-max)) + (if (looking-back "\n") + (delete-char -1)) + (buffer-string))))) + ;; We put version info into the executable in the form that `ident' uses. (or (eq system-type 'windows-nt) (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version))