Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
107794:c4daeb1eaaf1 | 107795:d47e1fb98df3 |
---|---|
590 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit")) | 590 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit")) |
591 (when limit (list "-n" (format "%s" limit))) | 591 (when limit (list "-n" (format "%s" limit))) |
592 (when start-revision (list start-revision)) | 592 (when start-revision (list start-revision)) |
593 '("--"))))))) | 593 '("--"))))))) |
594 | 594 |
595 (defun vc-git-log-outgoing (buffer remote-location) | |
596 (interactive) | |
597 (vc-git-command | |
598 buffer 0 nil | |
599 "log" (if (string= remote-location "") | |
600 ;; FIXME: this hardcodes the location, it should compute | |
601 ;; it properly. | |
602 "origin/master..HEAD" | |
603 remote-location))) | |
604 | |
595 (defvar log-view-message-re) | 605 (defvar log-view-message-re) |
596 (defvar log-view-file-re) | 606 (defvar log-view-file-re) |
597 (defvar log-view-font-lock-keywords) | 607 (defvar log-view-font-lock-keywords) |
598 (defvar log-view-per-file-logs) | 608 (defvar log-view-per-file-logs) |
599 | |
600 ;; Dynamically bound. | |
601 (defvar vc-short-log) | |
602 | 609 |
603 (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" | 610 (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" |
604 (require 'add-log) ;; We need the faces add-log. | 611 (require 'add-log) ;; We need the faces add-log. |
605 ;; Don't have file markers, so use impossible regexp. | 612 ;; Don't have file markers, so use impossible regexp. |
606 (set (make-local-variable 'log-view-file-re) "\\`a\\`") | 613 (set (make-local-variable 'log-view-file-re) "\\`a\\`") |
607 (set (make-local-variable 'log-view-per-file-logs) nil) | 614 (set (make-local-variable 'log-view-per-file-logs) nil) |
608 (set (make-local-variable 'log-view-message-re) | 615 (set (make-local-variable 'log-view-message-re) |
609 (if vc-short-log | 616 (if (eq vc-log-view-type 'short) |
610 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" | 617 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" |
611 "^commit *\\([0-9a-z]+\\)")) | 618 "^commit *\\([0-9a-z]+\\)")) |
612 (set (make-local-variable 'log-view-font-lock-keywords) | 619 (set (make-local-variable 'log-view-font-lock-keywords) |
613 (if vc-short-log | 620 (if (eq vc-log-view-type 'short) |
614 '( | 621 '( |
615 ;; Same as log-view-message-re, except that we don't | 622 ;; Same as log-view-message-re, except that we don't |
616 ;; want the shy group for the tag name. | 623 ;; want the shy group for the tag name. |
617 ("^\\(?:[*/\\| ]+ \\)?\\( ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" | 624 ("^\\(?:[*/\\| ]+ \\)?\\( ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" |
618 (1 'highlight nil lax) | 625 (1 'highlight nil lax) |