emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog vc-bzr.el vc-cvs.el vc-git...


From: Dan Nicolaescu
Subject: [Emacs-diffs] emacs/lisp ChangeLog vc-bzr.el vc-cvs.el vc-git...
Date: Sun, 15 Nov 2009 20:29:03 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   09/11/15 20:29:02

Modified files:
        lisp           : ChangeLog vc-bzr.el vc-cvs.el vc-git.el 
                         vc-hg.el vc-mtn.el vc-rcs.el vc-sccs.el 
                         vc-svn.el vc.el 

Log message:
        * vc.el (vc-log-show-limit): New variable.
        (vc-print-log, vc-print-root-log): Add new argument LIMIT.  Set it
        when using a prefix argument.
        (vc-print-log-internal): Add new argument LIMIT.
        
        * vc-svn.el (vc-svn-print-log):
        * vc-mtn.el (vc-mtn-print-log):
        * vc-hg.el (vc-hg-print-log):
        * vc-bzr.el (vc-bzr-print-log): Add new optional argument LIMIT,
        pass it to the log command when set. Make the BUFFER argument
        non-optional.
        
        * vc-sccs.el (vc-sccs-print-log):
        * vc-rcs.el (vc-rcs-print-log):
        * vc-git.el (vc-git-print-log):
        * vc-cvs.el (vc-cvs-print-log): Add new optional argument LIMIT,
        ignore it.  Make the BUFFER argument non-optional

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16640&r2=1.16641
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-bzr.el?cvsroot=emacs&r1=1.84&r2=1.85
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-cvs.el?cvsroot=emacs&r1=1.171&r2=1.172
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-git.el?cvsroot=emacs&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-hg.el?cvsroot=emacs&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-mtn.el?cvsroot=emacs&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-rcs.el?cvsroot=emacs&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-sccs.el?cvsroot=emacs&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-svn.el?cvsroot=emacs&r1=1.118&r2=1.119
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc.el?cvsroot=emacs&r1=1.738&r2=1.739

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16640
retrieving revision 1.16641
diff -u -b -r1.16640 -r1.16641
--- ChangeLog   15 Nov 2009 20:25:55 -0000      1.16640
+++ ChangeLog   15 Nov 2009 20:28:58 -0000      1.16641
@@ -1,5 +1,23 @@
 2009-11-15  Dan Nicolaescu  <address@hidden>
 
+       * vc.el (vc-log-show-limit): New variable.
+       (vc-print-log, vc-print-root-log): Add new argument LIMIT.  Set it
+       when using a prefix argument.
+       (vc-print-log-internal): Add new argument LIMIT.
+
+       * vc-svn.el (vc-svn-print-log):
+       * vc-mtn.el (vc-mtn-print-log):
+       * vc-hg.el (vc-hg-print-log):
+       * vc-bzr.el (vc-bzr-print-log): Add new optional argument LIMIT,
+       pass it to the log command when set. Make the BUFFER argument
+       non-optional.
+
+       * vc-sccs.el (vc-sccs-print-log):
+       * vc-rcs.el (vc-rcs-print-log):
+       * vc-git.el (vc-git-print-log):
+       * vc-cvs.el (vc-cvs-print-log): Add new optional argument LIMIT,
+       ignore it.  Make the BUFFER argument non-optional
+
        * bindings.el (mode-line-buffer-identification): Do not purecopy.
 
 2009-11-15  Chong Yidong  <address@hidden>

Index: vc-bzr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-bzr.el,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- vc-bzr.el   30 Oct 2009 05:48:16 -0000      1.84
+++ vc-bzr.el   15 Nov 2009 20:29:01 -0000      1.85
@@ -481,7 +481,7 @@
                    (2 'change-log-email))
                   ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face)))))))
 
-(defun vc-bzr-print-log (files &optional buffer shortlog) ; get buffer arg in 
Emacs 22
+(defun vc-bzr-print-log (files buffer &optional shortlog limit)
   "Get bzr change log for FILES into specified BUFFER."
   ;; `vc-do-command' creates the buffer, but we need it before running
   ;; the command.
@@ -493,7 +493,8 @@
   ;; way of getting the above regexps working.
   (with-current-buffer buffer
     (apply 'vc-bzr-command "log" buffer 'async files
-          (if shortlog "--short")
+          (when shortlog "--short")
+          (when limit (list "-l" (format "%s" limit)))
           (if (stringp vc-bzr-log-switches)
               (list vc-bzr-log-switches)
             vc-bzr-log-switches))))

Index: vc-cvs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-cvs.el,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- vc-cvs.el   1 Oct 2009 02:23:33 -0000       1.171
+++ vc-cvs.el   15 Nov 2009 20:29:01 -0000      1.172
@@ -496,7 +496,7 @@
 
 (declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
 
-(defun vc-cvs-print-log (files &optional buffer shortlog)
+(defun vc-cvs-print-log (files buffer &optional shortlog limit)
   "Get change logs associated with FILES."
   (require 'vc-rcs)
   ;; It's just the catenation of the individual logs.

Index: vc-git.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-git.el,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- vc-git.el   5 Nov 2009 03:24:12 -0000       1.97
+++ vc-git.el   15 Nov 2009 20:29:01 -0000      1.98
@@ -77,7 +77,7 @@
 ;; - merge-news (file)                     see `merge'
 ;; - steal-lock (file &optional revision)          NOT NEEDED
 ;; HISTORY FUNCTIONS
-;; * print-log (files &optional buffer shortlog)   OK
+;; * print-log (files buffer &optional shortlog limit)   OK
 ;; - log-view-mode ()                              OK
 ;; - show-log-entry (revision)                     OK
 ;; - comment-history (file)                        ??
@@ -508,7 +508,7 @@
 
 ;;; HISTORY FUNCTIONS
 
-(defun vc-git-print-log (files &optional buffer shortlog)
+(defun vc-git-print-log (files buffer &optional shortlog limit)
   "Get change log associated with FILES."
   (let ((coding-system-for-read git-commits-coding-system))
     ;; `vc-do-command' creates the buffer, but we need it before running

Index: vc-hg.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-hg.el,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- vc-hg.el    28 Oct 2009 02:05:50 -0000      1.105
+++ vc-hg.el    15 Nov 2009 20:29:01 -0000      1.106
@@ -68,7 +68,7 @@
 ;; - merge-news (file)                         NEEDED
 ;; - steal-lock (file &optional revision)      NOT NEEDED
 ;; HISTORY FUNCTIONS
-;; * print-log (files &optional buffer shortlog)OK
+;; * print-log (files buffer &optional shortlog) OK
 ;; - log-view-mode ()                          OK
 ;; - show-log-entry (revision)                 NOT NEEDED, DEFAULT IS GOOD
 ;; - comment-history (file)                    NOT NEEDED
@@ -219,12 +219,8 @@
                  (repeat :tag "Argument List" :value ("") string))
   :group 'vc-hg)
 
-(defun vc-hg-print-log (files &optional buffer shortlog)
+(defun vc-hg-print-log (files buffer &optional shortlog limit)
   "Get change log associated with FILES."
-  ;; `log-view-mode' needs to have the file names in order to function
-  ;; correctly. "hg log" does not print it, so we insert it here by
-  ;; hand.
-
   ;; `vc-do-command' creates the buffer, but we need it before running
   ;; the command.
   (vc-setup-buffer buffer)
@@ -234,8 +230,9 @@
     (with-current-buffer
        buffer
       (apply 'vc-hg-command buffer 0 files "log"
-            (if shortlog
-                 (append '("--style" "compact") vc-hg-log-switches)
+            (append
+             (when limit (list "-l" (format "%s" limit)))
+             (when shortlog '("--style" "compact"))
                  vc-hg-log-switches)))))
 
 (defvar log-view-message-re)

Index: vc-mtn.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-mtn.el,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- vc-mtn.el   14 Sep 2009 04:42:07 -0000      1.26
+++ vc-mtn.el   15 Nov 2009 20:29:02 -0000      1.27
@@ -188,8 +188,9 @@
 ;; (defun vc-mtn-roolback (files)
 ;;   )
 
-(defun vc-mtn-print-log (files &optional buffer shortlog)
-  (vc-mtn-command buffer 0 files "log"))
+(defun vc-mtn-print-log (files buffer &optional shortlog limit)
+  (apply 'vc-mtn-command buffer 0 files "log"
+        (when limit (list "--last" (format "%s" limit)))))
 
 (defvar log-view-message-re)
 (defvar log-view-file-re)

Index: vc-rcs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-rcs.el,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- vc-rcs.el   13 Nov 2009 22:19:56 -0000      1.96
+++ vc-rcs.el   15 Nov 2009 20:29:02 -0000      1.97
@@ -559,7 +559,7 @@
     (when (looking-at "[\b\t\n\v\f\r ]+")
       (delete-char (- (match-end 0) (match-beginning 0))))))
 
-(defun vc-rcs-print-log (files &optional buffer shortlog)
+(defun vc-rcs-print-log (files buffer &optional shortlog limit)
   "Get change log associated with FILE.  If FILE is a
 directory the operation is applied to all registered files beneath it."
   (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs 
files)))

Index: vc-sccs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-sccs.el,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- vc-sccs.el  11 Nov 2009 05:49:13 -0000      1.69
+++ vc-sccs.el  15 Nov 2009 20:29:02 -0000      1.70
@@ -335,7 +335,7 @@
 ;;; History functions
 ;;;
 
-(defun vc-sccs-print-log (files &optional buffer shortlog)
+(defun vc-sccs-print-log (files buffer &optional shortlog limit)
   "Get change log associated with FILES."
   (setq files (vc-expand-dirs files))
   (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-name files)))

Index: vc-svn.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-svn.el,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -b -r1.118 -r1.119
--- vc-svn.el   14 Sep 2009 04:42:07 -0000      1.118
+++ vc-svn.el   15 Nov 2009 20:29:02 -0000      1.119
@@ -462,7 +462,7 @@
   (require 'add-log)
   (set (make-local-variable 'log-view-per-file-logs) nil))
 
-(defun vc-svn-print-log (files &optional buffer shortlog)
+(defun vc-svn-print-log (files buffer &optional shortlog limit)
   "Get change log(s) associated with FILES."
   (save-current-buffer
     (vc-setup-buffer buffer)
@@ -471,7 +471,8 @@
       (if files
          (dolist (file files)
                  (insert "Working file: " file "\n")
-                 (vc-svn-command
+                 (apply
+                  'vc-svn-command
                   buffer
                   'async
                   ;; (if (and (= (length files) 1) (vc-stay-local-p file 
'SVN)) 'async 0)
@@ -481,9 +482,11 @@
                   ;; working revision, whereas we also want the log of the
                   ;; subsequent commits.  At least that's what the
                   ;; vc-cvs.el code does.
-                  "-rHEAD:0"))
+                  "-rHEAD:0"
+                  (when limit (list "-l" (format "%s" limit)))))
        ;; Dump log for the entire directory.
-       (vc-svn-command buffer 0 nil "log" "-rHEAD:0")))))
+       (apply vc-svn-command buffer 0 nil "log" "-rHEAD:0"
+              (when limit (list "-l" (format "%s" limit))))))))
 
 (defun vc-svn-diff (files &optional oldvers newvers buffer)
   "Get a difference report using SVN between two revisions of fileset FILES."

Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.738
retrieving revision 1.739
diff -u -b -r1.738 -r1.739
--- vc.el       24 Oct 2009 06:34:29 -0000      1.738
+++ vc.el       15 Nov 2009 20:29:02 -0000      1.739
@@ -333,12 +333,11 @@
 ;;
 ;; HISTORY FUNCTIONS
 ;;
-;; * print-log (files &optional buffer shortlog)
+;; * print-log (files buffer &optional shortlog limit)
 ;;
-;;   Insert the revision log for FILES into BUFFER, or the *vc* buffer
-;;   if BUFFER is nil.  (Note: older versions of this function expected
-;;   only a single file argument.)
+;;   Insert the revision log for FILES into BUFFER.
 ;;   If SHORTLOG is true insert a short version of the log.
+;;   If LIMIT is true insert only insert LIMIT log entries.
 ;;
 ;; - log-view-mode ()
 ;;
@@ -695,6 +694,13 @@
   :type '(choice (const :tag "Work out" nil) (const yes) (const no))
   :group 'vc)
 
+(defcustom vc-log-show-limit 0
+  "Limit the number of items shown by the VC log commands.
+Zero means unlimited.
+Not all VC backends are able to support this feature."
+  :type 'integer
+  :group 'vc)
+
 (defcustom vc-allow-async-revert nil
   "Specifies whether the diff during \\[vc-revert] may be asynchronous.
 Enabling this option means that you can confirm a revert operation even
@@ -1839,7 +1845,7 @@
 If it contains `file' then show short logs for files.
 Not all VC backends support short logs!")
 
-(defun vc-print-log-internal (backend files working-revision)
+(defun vc-print-log-internal (backend files working-revision limit)
   ;; Don't switch to the output buffer before running the command,
   ;; so that any buffer-local settings in the vc-controlled
   ;; buffer can be accessed by the command.
@@ -1852,7 +1858,7 @@
          (not (null (if dir-present
                         (memq 'directory vc-log-short-style)
                       (memq 'file vc-log-short-style)))))
-    (vc-call-backend backend 'print-log files "*vc-change-log*" vc-short-log)
+    (vc-call-backend backend 'print-log files "*vc-change-log*" vc-short-log 
limit)
     (pop-to-buffer "*vc-change-log*")
     (vc-exec-after
      `(let ((inhibit-read-only t)
@@ -1868,20 +1874,45 @@
        (set-buffer-modified-p nil)))))
 
 ;;;###autoload
-(defun vc-print-log (&optional working-revision)
+(defun vc-print-log (&optional working-revision limit)
   "List the change log of the current fileset in a window.
 If WORKING-REVISION is non-nil, leave the point at that revision."
-  (interactive)
+  (interactive
+   (cond
+    (current-prefix-arg
+     (let ((rev (read-from-minibuffer "Log from revision (default: last 
revision): " nil
+                                     nil nil nil))
+          (lim (string-to-number
+                (read-from-minibuffer
+                 "Limit display (unlimited: 0): "
+                 (format "%s" vc-log-show-limit)
+                 nil nil nil))))
+       (when (string= rev "") (setq rev nil))
+       (when (<= lim 0) (setq lim nil))
+       (list rev lim)))
+    (t
+     (list nil nil))))
   (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
         (backend (car vc-fileset))
         (files (cadr vc-fileset))
         (working-revision (or working-revision (vc-working-revision (car 
files)))))
-    (vc-print-log-internal backend files working-revision)))
+    (vc-print-log-internal backend files working-revision limit)))
 
 ;;;###autoload
-(defun vc-print-root-log ()
+(defun vc-print-root-log (&optional limit)
   "List the change log of for the current VC controlled tree in a window."
-  (interactive)
+  (interactive
+   (cond
+    (current-prefix-arg
+     (let ((lim (string-to-number
+                (read-from-minibuffer
+                 "Limit display (unlimited: 0): "
+                 (format "%s" vc-log-show-limit)
+                 nil nil nil))))
+       (when (<= lim 0) (setq lim nil))
+       (list lim)))
+    (t
+     (list nil))))
   (let ((backend
         (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
               (vc-mode (vc-backend buffer-file-name))))
@@ -1890,7 +1921,7 @@
       (error "Buffer is not version controlled"))
     (setq rootdir (vc-call-backend backend 'root default-directory))
     (setq working-revision (vc-working-revision rootdir))
-    (vc-print-log-internal backend (list rootdir) working-revision)))
+    (vc-print-log-internal backend (list rootdir) working-revision limit)))
 
 ;;;###autoload
 (defun vc-revert ()




reply via email to

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