* vc.el (vc-log-show-limit): Default to 2000.
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 16 Nov 2009 20:36:06 +0000 (20:36 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 16 Nov 2009 20:36:06 +0000 (20:36 +0000)
(vc-print-log-internal): Insert buttons to request more entries
when limiting the output.

* vc-sccs.el (vc-sccs-print-log):
* vc-rcs.el (vc-rcs-print-log):
* vc-cvs.el (vc-cvs-print-log):
* vc-git.el (vc-git-print-log): Return 'limit-unsupported when
LIMIT is non-nil.

etc/NEWS
lisp/ChangeLog
lisp/vc-cvs.el
lisp/vc-git.el
lisp/vc-rcs.el
lisp/vc-sccs.el
lisp/vc.el

index 63096f4..7fbb7d2 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -201,6 +201,13 @@ file.
 *** FIXME: add info about the new VC functions: vc-root-diff and
 vc-root-print-log once they stabilize.
 
+*** The log functions (C-x v l and C-x v L) do not show the full log
+by default anymore.  The number of entries shown can be chosen
+interactively with a prefix argument, by customizing
+vc-log-show-limit.  The log buffer display buttons that can be used
+to change the number of entries shown.
+RCS, SCCS, CVS and Git do not support this feature.
+
 *** vc-annotate supports annotations through file copies and renames,
 it displays the old names for the files and it can show logs/diffs for
 the corresponding lines.  Currently only Git and Mercurial take
index fe04aee..67a5644 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-16  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el (vc-log-show-limit): Default to 2000.
+       (vc-print-log-internal): Insert buttons to request more entries
+       when limiting the output.
+
+       * vc-sccs.el (vc-sccs-print-log):
+       * vc-rcs.el (vc-rcs-print-log):
+       * vc-cvs.el (vc-cvs-print-log):
+       * vc-git.el (vc-git-print-log): Return 'limit-unsupported when
+       LIMIT is non-nil.
+
 2009-11-16  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
index 8878046..3912532 100644 (file)
@@ -505,7 +505,8 @@ Will fail unless you have administrative privileges on the repo."
    (if (vc-stay-local-p files 'CVS) 'async 0)
    files "log")
   (with-current-buffer buffer
-    (vc-exec-after (vc-rcs-print-log-cleanup))))
+    (vc-exec-after (vc-rcs-print-log-cleanup)))
+  (when limit 'limit-unsupported))
 
 (defun vc-cvs-comment-history (file)
   "Get comment history of a file."
index c2900dd..072f708 100644 (file)
@@ -526,7 +526,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
                            "--")
          (vc-git-command buffer 'async files
                          "rev-list" ;; "--graph"
-                         "--pretty" "HEAD" "--"))))))
+                         "--pretty" "HEAD" "--")))
+        (when limit 'limit-unsupported))))
 
 (defvar log-view-message-re)
 (defvar log-view-file-re)
index 42e2ec3..38573e4 100644 (file)
@@ -564,7 +564,8 @@ directory the operation is applied to all registered files beneath it."
 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)))
   (with-current-buffer (or buffer "*vc*")
-    (vc-rcs-print-log-cleanup)))
+    (vc-rcs-print-log-cleanup))
+  (when limit 'limit-unsupported))
 
 (defun vc-rcs-diff (files &optional oldvers newvers buffer)
   "Get a difference report using RCS between two sets of files."
index 4c72e3b..2dda128 100644 (file)
@@ -338,7 +338,8 @@ revert all subfiles."
 (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)))
+  (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-name files))
+  (when limit 'limit-unsupported))
 
 (defun vc-sccs-diff (files &optional oldvers newvers buffer)
   "Get a difference report using SCCS between two filesets."
index 9c38d98..f58ba6e 100644 (file)
 ;;
 ;;   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.
+;;   If LIMIT is true insert only insert LIMIT log entries.  If the
+;;   backend does not support limiting the number of entries to show
+;;   it should return `limit-unsupported'.
 ;;
 ;; - log-view-mode ()
 ;;
@@ -694,7 +696,7 @@ to use -L and sets this variable to remember whether it worked."
   :type '(choice (const :tag "Work out" nil) (const yes) (const no))
   :group 'vc)
 
-(defcustom vc-log-show-limit 0
+(defcustom vc-log-show-limit 2000
   "Limit the number of items shown by the VC log commands.
 Zero means unlimited.
 Not all VC backends are able to support this feature."
@@ -1850,7 +1852,8 @@ Not all VC backends support short logs!")
   ;; so that any buffer-local settings in the vc-controlled
   ;; buffer can be accessed by the command.
   (let ((dir-present nil)
-       (vc-short-log nil))
+       (vc-short-log nil)
+       pl-return)
     (dolist (file files)
       (when (file-directory-p file)
        (setq dir-present t)))
@@ -1858,7 +1861,9 @@ Not all VC backends support short logs!")
          (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 limit)
+
+    (setq pl-return (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)
@@ -1867,6 +1872,23 @@ Not all VC backends support short logs!")
        (set (make-local-variable 'log-view-vc-backend) ',backend)
        (set (make-local-variable 'log-view-vc-fileset) ',files)
 
+       (when (and ,limit (not (eq 'limit-unsupported pl-return)))
+         (goto-char (point-max))
+         (widget-create 'push-button
+                        :notify (lambda (&rest ignore)
+                                  (vc-print-log-internal
+                                   ',backend ',files ',working-revision (* 2 ,limit)))
+                        :help-echo "Show the log again, and double the number of log entries shown"
+                        "Show 2X entries")
+         (widget-insert "    ")
+         (widget-create 'push-button
+                        :notify (lambda (&rest ignore)
+                                  (vc-print-log-internal
+                                   ',backend ',files ',working-revision nil))
+                        :help-echo "Show the log again, showing all entries"
+                        "Show unlimited entries")
+         (widget-setup))
+
        (shrink-window-if-larger-than-buffer)
        ;; move point to the log entry for the working revision
        (vc-call-backend ',backend 'show-log-entry ',working-revision)