From: Glenn Morris <rgm@gnu.org>
To: 8054@debbugs.gnu.org
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 [thread overview]
Message-ID: <xpbos56kz3.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87mxlrvf2p.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 19 Feb 2011 17:23:42 -0500")
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))
next prev parent reply other threads:[~2011-11-22 0:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <handler.8054.D8054.133382844412487.notifdone@debbugs.gnu.org>
2011-02-16 12:54 ` bug#8054: 24.0.50; Who ever heard of a version number that doesn't change all year? jidanni
2011-02-16 13:10 ` Lennart Borgman
2011-02-19 22:14 ` Chong Yidong
2011-02-19 22:22 ` Lennart Borgman
2011-02-19 22:23 ` Chong Yidong
2011-02-19 22:35 ` Lennart Borgman
2011-11-22 0:48 ` Glenn Morris [this message]
2011-11-23 13:03 ` Juanma Barranquero
2011-11-23 13:24 ` Christoph Scholtes
2012-04-07 19:53 ` Glenn Morris
2011-11-23 13:37 ` Lennart Borgman
2011-11-24 6:20 ` Chong Yidong
2011-11-24 7:06 ` Glenn Morris
2011-02-26 3:04 ` debbugs-submit-bounces
2011-02-26 3:51 ` Glenn Morris
2012-04-13 0:26 ` bug#8054: closed (Re: bug#8054: 24.0.50; Who ever heard of a version number that doesn't change all year?) jidanni
2012-04-13 3:00 ` Glenn Morris
2012-04-13 18:48 ` bug#8054: 24.0.50; Who ever heard of a version number that doesn't change all year? jidanni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xpbos56kz3.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=8054@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).