diff lisp/vc-git.el @ 107795:d47e1fb98df3

Add new VC methods: vc-log-incoming and vc-log-outgoing. * vc.el (vc-print-log-setup-buttons): New function split out from vc-print-log-internal. (vc-log-internal-common): New function, a parametrized version of vc-print-log-internal. (vc-print-log-internal): Just call vc-log-internal-common with the right arguments. (vc-incoming-outgoing-internal): (vc-log-incoming, vc-log-outgoing): New functions. (vc-log-view-type): New permanent local variable. * vc-hooks.el (vc-menu-map): Bind vc-log-incoming and vc-log-outgoing. * vc-bzr.el (vc-bzr-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. (vc-bzr-log-incoming, vc-bzr-log-outgoing): New functions. * vc-git.el (vc-git-log-outgoing): New function. (vc-git-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. * vc-hg.el (vc-hg-log-view-mode): Use vc-log-view-type instead of the dynamic bound vc-short-log. Highlight the tag. (vc-hg-log-incoming, vc-hg-log-outgoing): New functions. (vc-hg-outgoing, vc-hg-incoming, vc-hg-outgoing-mode): (vc-hg-incoming-mode): Remove. (vc-hg-extra-menu-map): Do not bind vc-hg-incoming and vc-hg-outgoing.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 06 Apr 2010 22:56:35 -0700
parents 1918e70c8b37
children 03ef65bf2e25
line wrap: on
line diff
--- a/lisp/vc-git.el	Tue Apr 06 21:14:56 2010 -0700
+++ b/lisp/vc-git.el	Tue Apr 06 22:56:35 2010 -0700
@@ -592,25 +592,32 @@
 		(when start-revision (list start-revision))
 		'("--")))))))
 
+(defun vc-git-log-outgoing (buffer remote-location)
+  (interactive)
+  (vc-git-command
+   buffer 0 nil
+   "log" (if (string= remote-location "")
+	     ;; FIXME: this hardcodes the location, it should compute
+	     ;; it properly.
+	     "origin/master..HEAD"
+	   remote-location)))
+
 (defvar log-view-message-re)
 (defvar log-view-file-re)
 (defvar log-view-font-lock-keywords)
 (defvar log-view-per-file-logs)
 
-;; Dynamically bound.
-(defvar vc-short-log)
-
 (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
   (require 'add-log) ;; We need the faces add-log.
   ;; Don't have file markers, so use impossible regexp.
   (set (make-local-variable 'log-view-file-re) "\\`a\\`")
   (set (make-local-variable 'log-view-per-file-logs) nil)
   (set (make-local-variable 'log-view-message-re)
-       (if vc-short-log
+       (if (eq vc-log-view-type 'short)
 	   "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\)  \\([-a-z0-9]+\\)  \\(.*\\)"
 	 "^commit *\\([0-9a-z]+\\)"))
   (set (make-local-variable 'log-view-font-lock-keywords)
-       (if vc-short-log
+       (if (eq vc-log-view-type 'short)
 	   '(
 	     ;; Same as log-view-message-re, except that we don't
 	     ;; want the shy group for the tag name.