emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107790: Add emacs-bzr-version


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107790: Add emacs-bzr-version
Date: Fri, 02 Nov 2012 01:17:43 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107790
fixes bug: http://debbugs.gnu.org/8054
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2012-04-07 12:51:51 -0700
message:
  Add emacs-bzr-version
  
  * lisp/version.el (emacs-bzr-get-version): New function.
  * lisp/loadup.el (emacs-bzr-version): Set it. 
  * lisp/mail/emacsbug.el (report-emacs-bug): Include bzr version.
  
  * etc/NEWS: Mention this, though it is not really relevant to releases.
  Insert template for 24.2 release.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/loadup.el
  lisp/mail/emacsbug.el
  lisp/version.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-04-07 13:57:36 +0000
+++ b/etc/NEWS  2012-04-07 19:51:51 +0000
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2010-2012  Free Software Foundation, Inc.
+Copyright (C) 2010-2012 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to address@hidden
@@ -14,6 +14,32 @@
 You can narrow news to a specific version by calling `view-emacs-news'
 with a prefix argument or by typing C-u C-h C-n.
 
+Temporary note:
++++ indicates that the appropriate manual has already been updated.
+--- means no change in the manuals is called for.
+When you add a new item, please add it without either +++ or ---
+so we will look at it and add it to the manual.
+
+
+* Installation Changes in Emacs 24.2
+
+* Startup Changes in Emacs 24.2
+
+* Changes in Emacs 24.2
+
+** If your Emacs was built from a bzr checkout, the new variable
+`emacs-bzr-version' contains information about which bzr revision was used.
+
+
+* Editing Changes in Emacs 24.2
+
+* Changes in Specialized Modes and Packages in Emacs 24.2
+
+* New Modes and Packages in Emacs 24.2
+
+* Incompatible Lisp Changes in Emacs 24.2
+
+* Lisp changes in Emacs 24.2
 
 * Changes in Emacs 24.2 on non-free operating systems
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-07 14:26:14 +0000
+++ b/lisp/ChangeLog    2012-04-07 19:51:51 +0000
@@ -1,3 +1,9 @@
+2012-04-07  Glenn Morris  <address@hidden>
+
+       * version.el (emacs-bzr-get-version): New function.
+       * loadup.el (emacs-bzr-version): Set it.  (Bug#8054)
+       * mail/emacsbug.el (report-emacs-bug): Include bzr version.
+
 2012-04-07  Eli Zaretskii  <address@hidden>
 
        * international/uni-bidi.el:

=== modified file 'lisp/loadup.el'
--- a/lisp/loadup.el    2012-01-19 07:21:25 +0000
+++ b/lisp/loadup.el    2012-04-07 19:51:51 +0000
@@ -259,6 +259,8 @@
           (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'
--- a/lisp/mail/emacsbug.el     2012-04-04 01:05:29 +0000
+++ b/lisp/mail/emacsbug.el     2012-04-07 19:51:51 +0000
@@ -239,6 +239,8 @@
     (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'
--- a/lisp/version.el   2012-02-09 07:48:22 +0000
+++ b/lisp/version.el   2012-04-07 19:51:51 +0000
@@ -79,6 +79,26 @@
 ;; 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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]