comparison lisp/vc-bzr.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 b958f43f6055
children bb75dfb8839a
comparison
equal deleted inserted replaced
107794:c4daeb1eaaf1 107795:d47e1fb98df3
476 (defvar log-view-message-re) 476 (defvar log-view-message-re)
477 (defvar log-view-file-re) 477 (defvar log-view-file-re)
478 (defvar log-view-font-lock-keywords) 478 (defvar log-view-font-lock-keywords)
479 (defvar log-view-current-tag-function) 479 (defvar log-view-current-tag-function)
480 (defvar log-view-per-file-logs) 480 (defvar log-view-per-file-logs)
481 (defvar vc-short-log)
482 481
483 (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" 482 (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View"
484 (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. 483 (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack.
485 (require 'add-log) 484 (require 'add-log)
486 (set (make-local-variable 'log-view-per-file-logs) nil) 485 (set (make-local-variable 'log-view-per-file-logs) nil)
487 (set (make-local-variable 'log-view-file-re) "\\`a\\`") 486 (set (make-local-variable 'log-view-file-re) "\\`a\\`")
488 (set (make-local-variable 'log-view-message-re) 487 (set (make-local-variable 'log-view-message-re)
489 (if vc-short-log 488 (if (eq vc-log-view-type 'short)
490 "^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?" 489 "^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
491 "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)")) 490 "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)"))
492 (set (make-local-variable 'log-view-font-lock-keywords) 491 (set (make-local-variable 'log-view-font-lock-keywords)
493 ;; log-view-font-lock-keywords is careful to use the buffer-local 492 ;; log-view-font-lock-keywords is careful to use the buffer-local
494 ;; value of log-view-message-re only since Emacs-23. 493 ;; value of log-view-message-re only since Emacs-23.
495 (if vc-short-log 494 (if (eq vc-log-view-type 'short)
496 (append `((,log-view-message-re 495 (append `((,log-view-message-re
497 (1 'log-view-message-face) 496 (1 'log-view-message-face)
498 (2 'change-log-name) 497 (2 'change-log-name)
499 (3 'change-log-date) 498 (3 'change-log-date)
500 (4 'change-log-list nil lax)))) 499 (4 'change-log-list nil lax))))
523 (when start-revision (list (format "-r..%s" start-revision))) 522 (when start-revision (list (format "-r..%s" start-revision)))
524 (when limit (list "-l" (format "%s" limit))) 523 (when limit (list "-l" (format "%s" limit)))
525 (if (stringp vc-bzr-log-switches) 524 (if (stringp vc-bzr-log-switches)
526 (list vc-bzr-log-switches) 525 (list vc-bzr-log-switches)
527 vc-bzr-log-switches))))) 526 vc-bzr-log-switches)))))
527
528 (defun vc-bzr-log-incoming (buffer remote-location)
529 (apply 'vc-bzr-command "missing" buffer 'async nil
530 (list "--theirs-only" (unless (string= remote-location "") remote-location))))
531
532 (defun vc-bzr-log-outgoing (buffer remote-location)
533 (apply 'vc-bzr-command "missing" buffer 'async nil
534 (list "--mine-only" (unless (string= remote-location "") remote-location))))
528 535
529 (defun vc-bzr-show-log-entry (revision) 536 (defun vc-bzr-show-log-entry (revision)
530 "Find entry for patch name REVISION in bzr change log buffer." 537 "Find entry for patch name REVISION in bzr change log buffer."
531 (goto-char (point-min)) 538 (goto-char (point-min))
532 (when revision 539 (when revision