comparison lisp/vc-git.el @ 108902:1f795f817d05

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 06 Jun 2010 22:46:17 +0000
parents 3e41dbf56aa2
children c05344a913c8
comparison
equal deleted inserted replaced
108901:10652acf752a 108902:1f795f817d05
604 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit")) 604 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit"))
605 (when limit (list "-n" (format "%s" limit))) 605 (when limit (list "-n" (format "%s" limit)))
606 (when start-revision (list start-revision)) 606 (when start-revision (list start-revision))
607 '("--"))))))) 607 '("--")))))))
608 608
609 (defun vc-git-compute-remote ()
610 (let ((str (with-output-to-string
611 (with-current-buffer standard-output
612 (vc-git--out-ok "symbolic-ref" "HEAD"))))
613 branch remote)
614 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
615 (progn
616 (setq branch (match-string 2 str))
617 (setq remote
618 (with-output-to-string
619 (with-current-buffer standard-output
620 (vc-git--out-ok "config"
621 (concat "branch." branch ".remote")))))
622 (when (string-match "\\([^\n]+\\)" remote)
623 (setq remote (match-string 1 remote)))))))
624
625
626 (defun vc-git-log-outgoing (buffer remote-location) 609 (defun vc-git-log-outgoing (buffer remote-location)
627 (interactive) 610 (interactive)
628 (vc-git-command 611 (vc-git-command
629 buffer 0 nil 612 buffer 0 nil
630 "log" (if (string= remote-location "") 613 "log"
631 (concat (vc-git-compute-remote) "..HEAD") 614 "--no-color" "--graph" "--decorate" "--date=short"
632 remote-location))) 615 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit"
633 616 (concat (if (string= remote-location "")
617 "@{upstream}"
618 remote-location)
619 "..HEAD")))
634 620
635 (defun vc-git-log-incoming (buffer remote-location) 621 (defun vc-git-log-incoming (buffer remote-location)
636 (interactive) 622 (interactive)
623 (vc-git-command nil 0 nil "fetch")
637 (vc-git-command 624 (vc-git-command
638 buffer 0 nil 625 buffer 0 nil
639 "log" (if (string= remote-location "") 626 "log"
640 (concat "HEAD.." (vc-git-compute-remote)) 627 "--no-color" "--graph" "--decorate" "--date=short"
641 remote-location))) 628 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit"
629 (concat "HEAD.." (if (string= remote-location "")
630 "@{upstream}"
631 remote-location))))
642 632
643 (defvar log-view-message-re) 633 (defvar log-view-message-re)
644 (defvar log-view-file-re) 634 (defvar log-view-file-re)
645 (defvar log-view-font-lock-keywords) 635 (defvar log-view-font-lock-keywords)
646 (defvar log-view-per-file-logs) 636 (defvar log-view-per-file-logs)
649 (require 'add-log) ;; We need the faces add-log. 639 (require 'add-log) ;; We need the faces add-log.
650 ;; Don't have file markers, so use impossible regexp. 640 ;; Don't have file markers, so use impossible regexp.
651 (set (make-local-variable 'log-view-file-re) "\\`a\\`") 641 (set (make-local-variable 'log-view-file-re) "\\`a\\`")
652 (set (make-local-variable 'log-view-per-file-logs) nil) 642 (set (make-local-variable 'log-view-per-file-logs) nil)
653 (set (make-local-variable 'log-view-message-re) 643 (set (make-local-variable 'log-view-message-re)
654 (if (eq vc-log-view-type 'short) 644 (if (not (eq vc-log-view-type 'long))
655 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" 645 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
656 "^commit *\\([0-9a-z]+\\)")) 646 "^commit *\\([0-9a-z]+\\)"))
657 (set (make-local-variable 'log-view-font-lock-keywords) 647 (set (make-local-variable 'log-view-font-lock-keywords)
658 (if (eq vc-log-view-type 'short) 648 (if (not (eq vc-log-view-type 'long))
659 '( 649 '(
660 ;; Same as log-view-message-re, except that we don't 650 ;; Same as log-view-message-re, except that we don't
661 ;; want the shy group for the tag name. 651 ;; want the shy group for the tag name.
662 ("^\\(?:[*/\\| ]+ \\)?\\( ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" 652 ("^\\(?:[*/\\| ]+ \\)?\\( ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
663 (1 'highlight nil lax) 653 (1 'highlight nil lax)