branch: elpa/vc-fossil commit cb4cd3f1bb315368ed6a31263bbb7a1db18faa6e Author: venkat <venkat> Commit: venkat <venkat>
Fossil version 3af6cf0993, moves update to end, simplifying our parsing. --- vc/el/vc-fossil.el | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el index e1013b5..78f42d2 100644 --- a/vc/el/vc-fossil.el +++ b/vc/el/vc-fossil.el @@ -109,14 +109,9 @@ (defun vc-fossil-state (file) "Fossil specific version of `vc-state'." ; (message (format "vc-fossil-state on %s" file)) - (with-temp-buffer - (insert (vc-fossil--run "update" "-n" "-v" "current" file)) - (goto-char (point-max)) - (forward-line -1) - (vc-fossil-state-code - (car - (split-string - (buffer-substring-no-properties (point) (buffer-end 1))))))) + (let ((line (vc-fossil--run "update" "-n" "-v" "current" file))) + (and line + (vc-fossil-state-code (car (split-string line)))))) (defun vc-fossil-working-revision (file) "Fossil Specific version of `vc-working-revision'." @@ -136,17 +131,18 @@ ;(message dir) (insert (vc-fossil--run "update" "-n" "-v" "current" dir)) (let* ((result) + (done nil) (root (vc-fossil-root dir))) (goto-char (point-min)) - (while (not (eobp)) + (while (and (not (eobp)) (not done)) (setq line (buffer-substring-no-properties (point) (line-end-position))) (setq status-word (car (split-string line))) - (setq file (substring line (+ (length status-word) 1))) + (setq done (string-match "-----" status-word)) + (setq file (if done "." (substring line (+ (length status-word) 1)))) (setq file (expand-file-name file root)) (setq file (file-relative-name file dir)) - (setq result (if (or (string-match ":" line) - (string-match "^[ \t]" line)) result - (cons (list file (vc-fossil-state-code status-word)) result))) + (setq result (if done result + (cons (list file (vc-fossil-state-code status-word)) result))) (forward-line)) (funcall update-function result nil))) @@ -221,7 +217,10 @@ ;; HISTORY FUNCTIONS -(defun vc-fossil-print-log (files &optional buffer) +;; FIXME, we actually already have short, start and limit, need to +;; add it into the code + +(defun vc-fossil-print-log (files buffer &optional shortlog start-revision limit) "Print full log for a file" (if files (progn