emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/vc-fossil 03282dc 063/111: Implement next-revision command


From: ELPA Syncer
Subject: [nongnu] elpa/vc-fossil 03282dc 063/111: Implement next-revision command for whole repository.
Date: Wed, 29 Sep 2021 08:59:22 -0400 (EDT)

branch: elpa/vc-fossil
commit 03282dc76166ece77f5207ed8778c5a79f7cefc1
Author: fifr <fifr>
Commit: fifr <fifr>

    Implement next-revision command for whole repository.
    
    If no file is specified, the revision succeeding the current one
    should be returned. This is required for the `log-view-diff-changeset`
    command to work.
---
 vc/el/vc-fossil.el | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el
index be99b7f..86c1344 100644
--- a/vc/el/vc-fossil.el
+++ b/vc/el/vc-fossil.el
@@ -356,21 +356,23 @@ If REV is specified, annotate that revision."
 
 (defun vc-fossil-next-revision (file rev)
   "Fossil specific version of the `vc-previous-revision'."
-  (when file
-    (with-temp-buffer
-      (let ((found (not rev))
-            (oldver nil))
-        (insert (vc-fossil--run "finfo" "-l" "-b" (file-truename file)))
-        ;; (vc-fossil--call "fossil" "finfo" "-l" "-b" file)
-        (goto-char (point-min))
-        (while (not (eobp))
-          (let* ((line (buffer-substring-no-properties (point) 
(line-end-position)))
-                 (version (car (split-string line))))
-            (setq found  (string= version rev))
-            (setq oldver (or oldver found version)))
-          (forward-line))
-        oldver))))
-
+  (if file
+      (with-temp-buffer
+        (let ((found (not rev))
+              (oldver nil))
+          (vc-fossil-command t 0 (file-truename file) "finfo" "-l" "-b")
+          ;; (vc-fossil--call "fossil" "finfo" "-l" "-b" file)
+          (goto-char (point-min))
+          (while (not (eobp))
+            (let* ((line (buffer-substring-no-properties (point) 
(line-end-position)))
+                   (version (car (split-string line))))
+              (setq found  (string= version rev))
+              (setq oldver (or oldver found version)))
+            (forward-line))
+          oldver))
+    (let ((info (vc-fossil--run "info" rev)))
+      (and (string-match "child: *\\([0-9a-fA-F]+\\)" info)
+           (match-string 1 info)))))
 
 (defun vc-fossil-delete-file (file)
   (vc-fossil-command nil 0 (file-truename file) "rm" "--hard"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]