diff options
| author | Dan Nicolaescu | 2008-06-13 14:51:06 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-06-13 14:51:06 +0000 |
| commit | 38b627cea0c61aa6837feab5db93815ea4b03d65 (patch) | |
| tree | 349482c99e7ee7791a9ce592267fabc195347ade /lisp | |
| parent | 05fae1be0c58e6c8b79de4ef82dae686c2f3d406 (diff) | |
| download | emacs-38b627cea0c61aa6837feab5db93815ea4b03d65.tar.gz emacs-38b627cea0c61aa6837feab5db93815ea4b03d65.zip | |
(vc-annotate-show-diff-revision-at-line): Move most of the code to ...
(vc-annotate-show-diff-revision-at-line-internal): ... here. New
function.
(vc-annotate-show-changeset-diff-revision-at-line): New function.
(vc-annotate-mode-menu): Bind it.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/vc.el | 27 |
2 files changed, 26 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4faca6f665..66baf0d960c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,12 @@ | |||
| 1 | 2008-06-13 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2008-06-13 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | * vc.el (vc-delete-file): Bound default-directory before calling | 3 | * vc.el (vc-delete-file): Bind default-directory before calling |
| 4 | the backend. | 4 | the backend. |
| 5 | (vc-annotate-show-diff-revision-at-line): Move most of the code to ... | ||
| 6 | (vc-annotate-show-diff-revision-at-line-internal): ... here. New | ||
| 7 | function. | ||
| 8 | (vc-annotate-show-changeset-diff-revision-at-line): New function. | ||
| 9 | (vc-annotate-mode-menu): Bind it. | ||
| 5 | 10 | ||
| 6 | 2008-06-13 Jason Rumney <jasonr@gnu.org> | 11 | 2008-06-13 Jason Rumney <jasonr@gnu.org> |
| 7 | 12 | ||
diff --git a/lisp/vc.el b/lisp/vc.el index 2c4a88124a9..e9af02d7403 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -2966,8 +2966,12 @@ cover the range from the oldest annotation to the newest." | |||
| 2966 | ["Show log of revision at line" vc-annotate-show-log-revision-at-line | 2966 | ["Show log of revision at line" vc-annotate-show-log-revision-at-line |
| 2967 | :help "Visit the log of the revision at line"] | 2967 | :help "Visit the log of the revision at line"] |
| 2968 | ["Show diff of revision at line" vc-annotate-show-diff-revision-at-line | 2968 | ["Show diff of revision at line" vc-annotate-show-diff-revision-at-line |
| 2969 | :help | 2969 | :help "Visit the diff of the revision at line from its previous revision"] |
| 2970 | "Visit the diff of the revision at line from its previous revision"] | 2970 | ["Show changeset diff of revision at line" |
| 2971 | vc-annotate-show-changeset-diff-revision-at-line | ||
| 2972 | :enable | ||
| 2973 | (eq 'repository (vc-call-backend ,vc-annotate-backend 'revision-granularity)) | ||
| 2974 | :help "Visit the diff of the revision at line from its previous revision"] | ||
| 2971 | ["Visit revision at line" vc-annotate-find-revision-at-line | 2975 | ["Visit revision at line" vc-annotate-find-revision-at-line |
| 2972 | :help "Visit the revision identified in the current line"])) | 2976 | :help "Visit the revision identified in the current line"])) |
| 2973 | 2977 | ||
| @@ -3158,9 +3162,7 @@ revisions after." | |||
| 3158 | (message "Cannot extract revision number from the current line") | 3162 | (message "Cannot extract revision number from the current line") |
| 3159 | (vc-print-log rev-at-line))))) | 3163 | (vc-print-log rev-at-line))))) |
| 3160 | 3164 | ||
| 3161 | (defun vc-annotate-show-diff-revision-at-line () | 3165 | (defun vc-annotate-show-diff-revision-at-line-internal (fileset) |
| 3162 | "Visit the diff of the revision at line from its previous revision." | ||
| 3163 | (interactive) | ||
| 3164 | (if (not (equal major-mode 'vc-annotate-mode)) | 3166 | (if (not (equal major-mode 'vc-annotate-mode)) |
| 3165 | (message "Cannot be invoked outside of a vc annotate buffer") | 3167 | (message "Cannot be invoked outside of a vc annotate buffer") |
| 3166 | (let ((rev-at-line (vc-annotate-extract-revision-at-line)) | 3168 | (let ((rev-at-line (vc-annotate-extract-revision-at-line)) |
| @@ -3177,11 +3179,22 @@ revisions after." | |||
| 3177 | nil | 3179 | nil |
| 3178 | ;; The value passed here should follow what | 3180 | ;; The value passed here should follow what |
| 3179 | ;; `vc-deduce-fileset' returns. | 3181 | ;; `vc-deduce-fileset' returns. |
| 3180 | (cons vc-annotate-backend | 3182 | (cons vc-annotate-backend (cons fileset nil)) |
| 3181 | (cons (list vc-annotate-parent-file) nil)) | ||
| 3182 | prev-rev rev-at-line)) | 3183 | prev-rev rev-at-line)) |
| 3183 | (switch-to-buffer "*vc-diff*")))))) | 3184 | (switch-to-buffer "*vc-diff*")))))) |
| 3184 | 3185 | ||
| 3186 | (defun vc-annotate-show-diff-revision-at-line () | ||
| 3187 | "Visit the diff of the revision at line from its previous revision." | ||
| 3188 | (interactive) | ||
| 3189 | (vc-annotate-show-diff-revision-at-line-internal (list vc-annotate-parent-file))) | ||
| 3190 | |||
| 3191 | (defun vc-annotate-show-changeset-diff-revision-at-line () | ||
| 3192 | "Visit the diff of the revision at line from its previous revision for all files in the changeset." | ||
| 3193 | (interactive) | ||
| 3194 | (when (eq 'file (vc-call-backend vc-annotate-backend 'revision-granularity)) | ||
| 3195 | (error "The %s backend does not support changeset diffs" vc-annotate-backend)) | ||
| 3196 | (vc-annotate-show-diff-revision-at-line-internal nil)) | ||
| 3197 | |||
| 3185 | (defun vc-annotate-warp-revision (revspec) | 3198 | (defun vc-annotate-warp-revision (revspec) |
| 3186 | "Annotate the revision described by REVSPEC. | 3199 | "Annotate the revision described by REVSPEC. |
| 3187 | 3200 | ||