branch: externals/vc-got
commit e9a5df0576d660dfc5d1d3e6bbb45406654e7dde
Author: Omar Polo <[email protected]>
Commit: Omar Polo <[email protected]>
make vc-annotate-show-diff-revision-at-line works
Improving vc-got-diff so the diff-at-line works in *Annotate* buffer.
vc-got-diff is still not 100% compliant to the interface thought. The
``diff against an empty tree'' is still missing.
---
vc-got.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 1da7887..92b9a8c 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -698,11 +698,15 @@ Heavily inspired by `vc-git-log-view-mode'."
(inhibit-read-only t))
(with-current-buffer buffer
(vc-got-with-worktree (car files)
- (cond ((and (null rev1)
- (null rev2))
- (dolist (file files)
- (vc-got--diff file)))
- (t (error "Not implemented")))))))
+ (if (and (null rev1)
+ (null rev2))
+ (dolist (file files)
+ (vc-got--diff file))
+ ;; TODO: if rev1 is nil, diff from the current version until
+ ;; rev2.
+ ;; TODO: if rev2 is nil as well, diff against an empty tree
+ ;; (i.e. get the patch from `got log -p rev1')
+ (vc-got--diff rev1 rev2))))))
(defun vc-got-annotate-command (file buf &optional rev)
"Show annotated contents of FILE in buffer BUF. If given, use revision REV."