diff options
| author | Dan Nicolaescu | 2010-06-01 03:40:09 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-06-01 03:40:09 -0700 |
| commit | 61158bfa572d2480bfb4e82f33bc212d6fe3e221 (patch) | |
| tree | 81523bac2c49337a44bfed571ab86889ddb398fe | |
| parent | 5828f6cacc56d892cd34fe0c4e0e033de1002b3f (diff) | |
| download | emacs-61158bfa572d2480bfb4e82f33bc212d6fe3e221.tar.gz emacs-61158bfa572d2480bfb4e82f33bc212d6fe3e221.zip | |
Add support for vc-log-incoming, improve vc-log-outgoing for Git.
* lisp/vc-git.el (vc-git-compute-remote): New function.
(vc-git-log-outgoing): Use it instead of hard coding a value.
(vc-git-log-incoming): New function.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc-git.el | 30 |
2 files changed, 32 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7b6bcd9cb2..a2c62a84a8e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2010-06-01 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2010-06-01 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | Add support for vc-log-incoming, improve vc-log-outgoing for Git. | ||
| 4 | * vc-git.el (vc-git-compute-remote): New function. | ||
| 5 | (vc-git-log-outgoing): Use it instead of hard coding a value. | ||
| 6 | (vc-git-log-incoming): New function. | ||
| 7 | |||
| 3 | Improve state updating for VC tag commands. | 8 | Improve state updating for VC tag commands. |
| 4 | * vc.el (vc-create-tag, vc-retrieve-tag): Call vc-resynch-buffer | 9 | * vc.el (vc-create-tag, vc-retrieve-tag): Call vc-resynch-buffer |
| 5 | to update the state of all buffers in the directory. | 10 | to update the state of all buffers in the directory. |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 7b740734892..4f67e1b0679 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -606,14 +606,38 @@ for the --graph option." | |||
| 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 | |||
| 609 | (defun vc-git-log-outgoing (buffer remote-location) | 626 | (defun vc-git-log-outgoing (buffer remote-location) |
| 610 | (interactive) | 627 | (interactive) |
| 611 | (vc-git-command | 628 | (vc-git-command |
| 612 | buffer 0 nil | 629 | buffer 0 nil |
| 613 | "log" (if (string= remote-location "") | 630 | "log" (if (string= remote-location "") |
| 614 | ;; FIXME: this hardcodes the location, it should compute | 631 | (concat (vc-git-compute-remote) "..HEAD") |
| 615 | ;; it properly. | 632 | remote-location))) |
| 616 | "origin/master..HEAD" | 633 | |
| 634 | |||
| 635 | (defun vc-git-log-incoming (buffer remote-location) | ||
| 636 | (interactive) | ||
| 637 | (vc-git-command | ||
| 638 | buffer 0 nil | ||
| 639 | "log" (if (string= remote-location "") | ||
| 640 | (concat "HEAD.." (vc-git-compute-remote)) | ||
| 617 | remote-location))) | 641 | remote-location))) |
| 618 | 642 | ||
| 619 | (defvar log-view-message-re) | 643 | (defvar log-view-message-re) |