aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/loadup.el2
-rw-r--r--lisp/mail/emacsbug.el2
-rw-r--r--lisp/version.el20
4 files changed, 30 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 027b6631639..179b7ff3a31 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-04-07 Glenn Morris <rgm@gnu.org>
2
3 * version.el (emacs-bzr-get-version): New function.
4 * loadup.el (emacs-bzr-version): Set it. (Bug#8054)
5 * mail/emacsbug.el (report-emacs-bug): Include bzr version.
6
12012-04-07 Eli Zaretskii <eliz@gnu.org> 72012-04-07 Eli Zaretskii <eliz@gnu.org>
2 8
3 * international/uni-bidi.el: 9 * international/uni-bidi.el:
diff --git a/lisp/loadup.el b/lisp/loadup.el
index b7af41d6246..16cd0171e61 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -259,6 +259,8 @@
259 (versions (mapcar (function (lambda (name) 259 (versions (mapcar (function (lambda (name)
260 (string-to-number (substring name (length base))))) 260 (string-to-number (substring name (length base)))))
261 files))) 261 files)))
262 (setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version)
263 (error nil)))
262 ;; `emacs-version' is a constant, so we shouldn't change it with `setq'. 264 ;; `emacs-version' is a constant, so we shouldn't change it with `setq'.
263 (defconst emacs-version 265 (defconst emacs-version
264 (format "%s.%d" 266 (format "%s.%d"
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 1a02ae7c519..33b73335a7d 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -239,6 +239,8 @@ usually do not have translators for other languages.\n\n")))
239 (add-text-properties (1+ user-point) (point) prompt-properties) 239 (add-text-properties (1+ user-point) (point) prompt-properties)
240 240
241 (insert "\n\nIn " (emacs-version) "\n") 241 (insert "\n\nIn " (emacs-version) "\n")
242 (if (stringp emacs-bzr-version)
243 (insert "Bzr revision: " emacs-bzr-version "\n"))
242 (if (fboundp 'x-server-vendor) 244 (if (fboundp 'x-server-vendor)
243 (condition-case nil 245 (condition-case nil
244 ;; This is used not only for X11 but also W32 and others. 246 ;; This is used not only for X11 but also W32 and others.
diff --git a/lisp/version.el b/lisp/version.el
index bd30f0f81b8..a4bc4fd54a6 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -79,6 +79,26 @@ to the system configuration; look at `system-configuration' instead."
79;; We hope that this alias is easier for people to find. 79;; We hope that this alias is easier for people to find.
80(defalias 'version 'emacs-version) 80(defalias 'version 'emacs-version)
81 81
82;; Set during dumping, this is a defvar so that it can be setq'd.
83(defvar emacs-bzr-version nil "\
84String giving the bzr revision number from which this Emacs was built.
85This is nil if Emacs was not built from a bzr checkout, or if we could
86not determine the revision.")
87
88(defun emacs-bzr-get-version () "\
89Try to return as a string the bzr revision number of the Emacs sources.
90Returns nil if the sources do not seem to be under bzr, or if we could
91not determine the revision. Note that this reports on the current state
92of the sources, which may not correspond to the running Emacs."
93 (let ((file (expand-file-name ".bzr/branch/last-revision" source-directory)))
94 (if (file-readable-p file)
95 (with-temp-buffer
96 (insert-file-contents file)
97 (goto-char (point-max))
98 (if (looking-back "\n")
99 (delete-char -1))
100 (buffer-string)))))
101
82;; We put version info into the executable in the form that `ident' uses. 102;; We put version info into the executable in the form that `ident' uses.
83(or (eq system-type 'windows-nt) 103(or (eq system-type 'windows-nt)
84 (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version)) 104 (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version))