branch: elpa/vc-fossil
commit 9e522645dcd3f5b269408893d051e07c700a7dd1
Author: barak <barak>
Commit: barak <barak>
emacs style (cont), some logic issues seem apparent...
---
vc/el/vc-fossil.el | 66 +++++++++++++++++++++++++++---------------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el
index 4c14dda..c51ada5 100644
--- a/vc/el/vc-fossil.el
+++ b/vc/el/vc-fossil.el
@@ -129,34 +129,36 @@
"Get Fossil status for all files in a directory"
;; (message dir)
(insert (vc-fossil--run "update" "-n" "-v" "current" dir))
- (let* ((result)
- (done nil)
- (root (vc-fossil-root dir))
- line status-word file)
+ (let ((result '())
+ (done nil)
+ (root (vc-fossil-root dir)))
(goto-char (point-min))
(while (and (not (eobp)) (not done))
- (setq line (buffer-substring-no-properties (point) (line-end-position)))
- (setq status-word (car (split-string line)))
- (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 done result
- (cons (list file (vc-fossil-state-code status-word))
result)))
+ (let* ((line (buffer-substring-no-properties (point)
(line-end-position)))
+ (status-word (car (split-string line))))
+ (setq done (string-match "-----" status-word))
+ (let ((file (if done "." (substring line (+ (length status-word) 1)))))
+ (let ((file (expand-file-name file root)))
+ (let ((file (file-relative-name file dir)))
+ (unless done
+ (setq result
+ (cons (list file (vc-fossil-state-code status-word))
+ result)))))))
(forward-line))
(funcall update-function result nil)))
(defun vc-fossil-after-dir-status (callback)
"Function to call after the status process has finished"
(message "after-dir-status called %s" (buffer-string))
- (let (result line state status-word file)
+ (let ((result '()))
(goto-char (point-min))
(while (not (eobp))
- (setq line (buffer-substring-no-properties (point) (line-end-position)))
- (message line)
- (setq state (vc-fossil-state-code (car (split-string line))))
- (setq file (expand-file-name (substring line (+ (length status-word)
1))))
- (setq result (cons (list file state) result))
+ (let ((line (buffer-substring-no-properties (point) (line-end-position)))
+ (status-word '()))
+ (message line)
+ (let* ((state (vc-fossil-state-code (car (split-string line))))
+ (file (expand-file-name (substring line (+ (length status-word)
1)))))
+ (setq result (cons (list file state) result))))
(forward-line))
(funcall callback result t)))
@@ -261,18 +263,17 @@
"Fossil specific version of the `vc-previous-revision'."
(when file
(with-temp-buffer
- (let* ((found (not rev))
- (newver nil)
- line version)
+ (let ((found (not rev))
+ (newver nil))
(insert (vc-fossil--run "finfo" "-l" "-b" file))
;; (vc-fossil--call "fossil" "finfo" "-l" "-b" file)
(goto-char (point-min))
(while (not (eobp))
- (setq line (buffer-substring-no-properties (point)
(line-end-position)))
- ;; (message line)
- (setq version (car (split-string line)))
- (setq newver (or newver (and found version)))
- (setq found (string= version rev))
+ (let* ((line (buffer-substring-no-properties (point)
(line-end-position)))
+ (version (car (split-string line))))
+ ;; (message line)
+ (setq newver (or newver (and found version)))
+ (setq found (string= version rev)))
(forward-line))
newver))))
@@ -280,17 +281,16 @@
"Fossil specific version of the `vc-previous-revision'."
(when file
(with-temp-buffer
- (let* ((found (not rev))
- (oldver nil)
- line version)
+ (let ((found (not rev))
+ (oldver nil))
(insert (vc-fossil--run "finfo" "-l" "-b" file))
;; (vc-fossil--call "fossil" "finfo" "-l" "-b" file)
(goto-char (point-min))
(while (not (eobp))
- (setq line (buffer-substring-no-properties (point)
(line-end-position)))
- (setq version (car (split-string line)))
- (setq found (string= version rev))
- (setq oldver (or oldver found version))
+ (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))))