emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109011: Allow use of vc-root-* comma


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109011: Allow use of vc-root-* commands in *vc-log* buffers.
Date: Wed, 11 Jul 2012 12:35:13 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109011
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-07-11 12:35:13 +0800
message:
  Allow use of vc-root-* commands in *vc-log* buffers.
  
  * lisp/vc/log-edit.el (log-edit-vc-backend): New variable.
  (log-edit): Doc fix.
  
  * lisp/vc/log-view.el (log-view-vc-fileset, log-view-vc-backend): Doc fix.
  
  * lisp/vc/vc-dispatcher.el (vc-log-edit): New args.  Use PARAMS
  argument of log-edit to set up all local variables.
  (vc-start-logentry): New optional arg specifying VC backend.
  
  * lisp/vc/vc.el (vc-checkin): Use it.
  (vc-deduce-fileset): Handle Log Edit buffers.
  (vc-diff): Make first argument optional too.
modified:
  lisp/ChangeLog
  lisp/vc/log-edit.el
  lisp/vc/log-view.el
  lisp/vc/vc-dispatcher.el
  lisp/vc/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-10 12:16:40 +0000
+++ b/lisp/ChangeLog    2012-07-11 04:35:13 +0000
@@ -1,3 +1,18 @@
+2012-07-11  Chong Yidong  <address@hidden>
+
+       * vc/log-edit.el (log-edit-vc-backend): New variable.
+       (log-edit): Doc fix.
+
+       * vc/vc-dispatcher.el (vc-log-edit): New args.  Use PARAMS
+       argument of log-edit to set up all local variables.
+       (vc-start-logentry): New optional arg specifying VC backend.
+
+       * vc/vc.el (vc-checkin): Use it.
+       (vc-deduce-fileset): Handle Log Edit buffers.
+       (vc-diff): Make first argument optional too.
+
+       * vc/log-view.el (log-view-vc-fileset, log-view-vc-backend): Doc fix.
+
 2012-07-10  Michael Albinus  <address@hidden>
 
        * eshell/esh-ext.el (eshell-remote-command): Remove remote part of

=== modified file 'lisp/vc/log-edit.el'
--- a/lisp/vc/log-edit.el       2012-07-10 11:51:54 +0000
+++ b/lisp/vc/log-edit.el       2012-07-11 04:35:13 +0000
@@ -190,6 +190,9 @@
 
 (defvar log-edit-parent-buffer nil)
 
+(defvar log-edit-vc-backend nil
+  "VC fileset corresponding to the current log.")
+
 ;;; Originally taken from VC-Log mode
 
 (defconst log-edit-maximum-comment-ring-size 32
@@ -405,23 +408,27 @@
 ;;;###autoload
 (defun log-edit (callback &optional setup params buffer mode &rest _ignore)
   "Setup a buffer to enter a log message.
-\\<log-edit-mode-map>The buffer will be put in mode MODE or `log-edit-mode'
-if MODE is nil.
-If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run.
-Mark and point will be set around the entire contents of the buffer so
-that it is easy to kill the contents of the buffer with \\[kill-region].
-Once you're done editing the message, pressing \\[log-edit-done] will call
-`log-edit-done' which will end up calling CALLBACK to do the actual commit.
+The buffer is put in mode MODE or `log-edit-mode' if MODE is nil.
+\\<log-edit-mode-map>
+If SETUP is non-nil, erase the buffer and run `log-edit-hook'.
+Set mark and point around the entire contents of the buffer, so
+that it is easy to kill the contents of the buffer with
+\\[kill-region].  Once the user is done editing the message,
+invoking the command \\[log-edit-done] (`log-edit-done') will
+call CALLBACK to do the actual commit.
 
-PARAMS if non-nil is an alist.  Possible keys and associated values:
+PARAMS if non-nil is an alist of variables and buffer-local
+values to give them in the Log Edit buffer.  Possible keys and
+associated values:
  `log-edit-listfun' -- function taking no arguments that returns the list of
  files that are concerned by the current operation (using relative names);
  `log-edit-diff-function' -- function taking no arguments that
  displays a diff of the files concerned by the current operation.
+ `vc-log-fileset' -- the VC fileset to be committed (if any).
 
-If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
-log message and go back to the current buffer when done.  Otherwise, it
-uses the current buffer."
+If BUFFER is non-nil `log-edit' will jump to that buffer, use it
+to edit the log message and go back to the current buffer when
+done.  Otherwise, it uses the current buffer."
   (let ((parent (current-buffer)))
     (if buffer (pop-to-buffer buffer))
     (when (and log-edit-setup-invert (not (eq setup 'force)))

=== modified file 'lisp/vc/log-view.el'
--- a/lisp/vc/log-view.el       2012-07-10 11:51:54 +0000
+++ b/lisp/vc/log-view.el       2012-07-11 04:35:13 +0000
@@ -245,10 +245,10 @@
   '(log-view-font-lock-keywords t nil nil nil))
 
 (defvar log-view-vc-fileset nil
-  "Set this to the fileset corresponding to the current log.")
+  "The VC fileset corresponding to the current log.")
 
 (defvar log-view-vc-backend nil
-  "Set this to the VC backend that created the current log.")
+  "The VC backend that created the current log.")
 
 ;;;;
 ;;;; Actual code

=== modified file 'lisp/vc/vc-dispatcher.el'
--- a/lisp/vc/vc-dispatcher.el  2012-04-16 23:57:09 +0000
+++ b/lisp/vc/vc-dispatcher.el  2012-07-11 04:35:13 +0000
@@ -575,10 +575,10 @@
 
 ;; Set up key bindings for use while editing log messages
 
-(defun vc-log-edit (fileset mode)
+(defun vc-log-edit (fileset mode backend)
   "Set up `log-edit' for use on FILE."
   (setq default-directory
-       (with-current-buffer vc-parent-buffer default-directory))
+       (buffer-local-value 'default-directory vc-parent-buffer))
   (log-edit 'vc-finish-logentry
            nil
            `((log-edit-listfun . (lambda ()
@@ -586,14 +586,15 @@
                                     ;; for directories.
                                     (mapcar 'file-relative-name
                                             ',fileset)))
-             (log-edit-diff-function . (lambda () (vc-diff nil))))
+             (log-edit-diff-function . vc-diff)
+             (log-edit-vc-backend . ,backend)
+             (vc-log-fileset . ,fileset))
            nil
            mode)
-  (set (make-local-variable 'vc-log-fileset) fileset)
   (set-buffer-modified-p nil)
   (setq buffer-file-name nil))
 
-(defun vc-start-logentry (files comment initial-contents msg logbuf mode 
action &optional after-hook)
+(defun vc-start-logentry (files comment initial-contents msg logbuf mode 
action &optional after-hook backend)
   "Accept a comment for an operation on FILES.
 If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
 action on close to ACTION.  If COMMENT is a string and
@@ -604,7 +605,8 @@
 empty comment.  Remember the file's buffer in `vc-parent-buffer'
 \(current one if no file).  Puts the log-entry buffer in major-mode
 MODE, defaulting to `log-edit-mode' if MODE is nil.
-AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'."
+AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'.
+BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer."
   (let ((parent
          (if (vc-dispatcher-browsing)
              ;; If we are called from a directory browser, the parent buffer is
@@ -619,7 +621,7 @@
     (set (make-local-variable 'vc-parent-buffer) parent)
     (set (make-local-variable 'vc-parent-buffer-name)
         (concat " from " (buffer-name vc-parent-buffer)))
-    (vc-log-edit files mode)
+    (vc-log-edit files mode backend)
     (make-local-variable 'vc-log-after-operation-hook)
     (when after-hook
       (setq vc-log-after-operation-hook after-hook))

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2012-05-29 11:41:45 +0000
+++ b/lisp/vc/vc.el     2012-07-11 04:35:13 +0000
@@ -936,11 +936,13 @@
 
 (defvar vc-dir-backend)
 (defvar log-view-vc-backend)
+(defvar log-edit-vc-backend)
 (defvar diff-vc-backend)
 
 (defun vc-deduce-backend ()
   (cond ((derived-mode-p 'vc-dir-mode)   vc-dir-backend)
        ((derived-mode-p 'log-view-mode) log-view-vc-backend)
+       ((derived-mode-p 'log-edit-mode) log-edit-vc-backend)
        ((derived-mode-p 'diff-mode)     diff-vc-backend)
         ;; Maybe we could even use comint-mode rather than shell-mode?
        ((derived-mode-p 'dired-mode 'shell-mode 'compilation-mode)
@@ -1434,7 +1436,8 @@
          (vc-checkout-time . ,(nth 5 (file-attributes file)))
          (vc-working-revision . nil)))
      (message "Checking in %s...done" (vc-delistify files)))
-   'vc-checkin-hook))
+   'vc-checkin-hook
+   backend))
 
 ;;; Additional entry points for examining version histories
 
@@ -1680,7 +1683,7 @@
                    (called-interactively-p 'interactive)))
 
 ;;;###autoload
-(defun vc-diff (historic &optional not-urgent)
+(defun vc-diff (&optional historic not-urgent)
   "Display diffs between file revisions.
 Normally this compares the currently selected fileset with their
 working revisions.  With a prefix argument HISTORIC, it reads two revision


reply via email to

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