[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got 961d35b 142/145: fix find-revision
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got 961d35b 142/145: fix find-revision |
Date: |
Thu, 9 Sep 2021 15:58:50 -0400 (EDT) |
branch: externals/vc-got
commit 961d35b50f3b03717f2cfc34ee5d5d7be4b22cd1
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
fix find-revision
I don't know why I bothered with `got tree' to get the object id and
stuff. `got cat' accepts filenames and does the trick.
While there, also drop vc-got--tree-parse and vc-got--tree as they're
now unused.
---
vc-got.el | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 5943a06..c860d7e 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -303,24 +303,6 @@ ROOT is the root of the repo."
(?m 'edited) ; modified file modes
(?N nil)))
-(defun vc-got--tree-parse ()
- "Parse into an alist the output of got tree -i in the current buffer."
- (goto-char (point-min))
- (let (alist)
- (while (re-search-forward "^\\([[:word:]]+\\) \\(?:.+\\)+$" nil t)
- (push (cons (match-string 2) (match-string 1)) alist))
- alist))
-
-(defun vc-got--tree (commit path)
- "Return an alist representing the got tree command output.
-The outputted tree will be localised in the given PATH at the
-given COMMIT."
- (vc-got-with-worktree path
- (let ((process-file-side-effects nil))
- (with-temp-buffer
- (when (zerop (vc-got--call "tree" "-c" commit "-i" "--" path))
- (vc-got--tree-parse))))))
-
(defun vc-got--cat (commit obj-id)
"Execute got cat -c COMMIT OBJ-ID in the current buffer."
(let (process-file-side-effects)
@@ -606,10 +588,9 @@ Got uses an implicit checkout model for every file."
(defun vc-got-find-revision (file rev buffer)
"Fill BUFFER with the content of FILE in the given revision REV."
- (when-let (obj-id (assoc file (vc-got--tree rev file) #'string=))
- (with-current-buffer buffer
- (vc-got-with-worktree file
- (vc-got--cat rev obj-id)))))
+ (with-current-buffer buffer
+ (vc-got-with-worktree file
+ (vc-got--cat rev (file-relative-name file)))))
(defun vc-got-checkout (_file &optional _rev)
"Checkout revision REV of FILE.
- [elpa] externals/vc-got 1d573c9 119/145: rename arguments to emphasize that they must be files, (continued)
- [elpa] externals/vc-got 1d573c9 119/145: rename arguments to emphasize that they must be files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 61b9a83 124/145: add the keyword `tools', like in vc-git, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 00eb9c8 127/145: add `lint' target, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 95a78ec 134/145: missing require and split setq-locals, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 4b3c0c6 132/145: add Timo as author, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 3ec8a8b 130/145: chores, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5154c5c 136/145: switch to `got send' for pushing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 3dcaa71 139/145: improve tag creation buffer, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got adbe5db 143/145: move the copyright to the FSF, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2a50da6 140/145: push doesn't use git anymore, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 961d35b 142/145: fix find-revision,
ELPA Syncer <=
- [elpa] externals/vc-got a1679b1 144/145: automatically register the backend and ignore the .got directory, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8fc127f 145/145: bump version, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5509116 018/145: implement vc-got-find-ignore-file, ELPA Syncer, 2021/09/09