[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vc-fossil eeb48f4 024/111: fiddle with some if constructs
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vc-fossil eeb48f4 024/111: fiddle with some if constructs so I can read this |
Date: |
Wed, 29 Sep 2021 08:59:14 -0400 (EDT) |
branch: elpa/vc-fossil
commit eeb48f4817d4577e4866daa4a9acfefd9b970a2e
Author: barak <barak>
Commit: barak <barak>
fiddle with some if constructs so I can read this
---
vc/el/vc-fossil.el | 107 +++++++++++++++++++++++++----------------------------
1 file changed, 51 insertions(+), 56 deletions(-)
diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el
index ac83798..3304de0 100644
--- a/vc/el/vc-fossil.el
+++ b/vc/el/vc-fossil.el
@@ -91,18 +91,17 @@
(not (string= (substring str 0 7) "unknown"))))))
(defun vc-fossil-state-code (code)
- (if (not code)
- 'unregistered
- (cond
- ((string= code "UNKNOWN") 'unregistered)
- ((string= code "UNCHANGED") 'up-to-date)
- ((string= code "CONFLICT") 'edited)
- ((string= code "ADDED") 'added)
- ((string= code "ADD") 'needs-update)
- ((string= code "EDITED") 'edited)
- ((string= code "REMOVE") 'removed)
- ((string= code "UPDATE") 'needs-update)
- ((string= code "MERGE") 'needs-merge))))
+ (cond ((not code) 'unregistered)
+ ((string= code "UNKNOWN") 'unregistered)
+ ((string= code "UNCHANGED") 'up-to-date)
+ ((string= code "CONFLICT") 'edited)
+ ((string= code "ADDED") 'added)
+ ((string= code "ADD") 'needs-update)
+ ((string= code "EDITED") 'edited)
+ ((string= code "REMOVE") 'removed)
+ ((string= code "UPDATE") 'needs-update)
+ ((string= code "MERGE") 'needs-merge)
+ (t nil)))
; (vc-fossil-state "/proj/fiesta/tools/fossil/emacs-fossil/vc/el/vc-fossil.el")
@@ -223,25 +222,21 @@
(defun vc-fossil-print-log (files buffer &optional shortlog start-revision
limit)
"Print full log for a file"
- (if files
- (progn
- (vc-fossil-command buffer 0 (car files) "finfo" "-l")
- (vc-fossil-print-log (cdr files) buffer))))
+ (when files
+ (vc-fossil-command buffer 0 (car files) "finfo" "-l")
+ (vc-fossil-print-log (cdr files) buffer)))
;; TBD: log-entry
(defun vc-fossil-diff (file &optional rev1 rev2 buffer)
"Get Differences for a file"
- ;(message (format "Get diffs between rev <%s> and <%s> for file <%s>" rev1
rev2 file))
+ ;; (message (format "Get diffs between rev <%s> and <%s> for file <%s>" rev1
rev2 file))
(let ((buf (or buffer "*vc-diff*")))
- (if (and rev1 rev2)
- (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1 "--to" rev2)
- (if rev1
- (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1)
- (if rev2
- (vc-fossil-command buf 0 file "diff" "-i" "--to" rev2)
- (vc-fossil-command buf 0 file "diff" "-i")
- )))))
+ (cond ((and rev1 rev2)
+ (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1 "--to" rev2))
+ (rev1 (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1))
+ (rev2 (vc-fossil-command buf 0 file "diff" "-i" "--to" rev2))
+ (t (vc-fossil-command buf 0 file "diff" "-i")))))
;;; TAG SYSTEM
@@ -265,40 +260,40 @@
(defun vc-fossil-previous-revision (file rev)
"Fossil specific version of the `vc-previous-revision'."
- (if file
- (with-temp-buffer
- (let* ((found (not rev))
- (newver nil)
- line version)
- (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))
- (forward-line))
- newver))))
+ (when file
+ (with-temp-buffer
+ (let* ((found (not rev))
+ (newver nil)
+ line version)
+ (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))
+ (forward-line))
+ newver))))
(defun vc-fossil-next-revision (file rev)
"Fossil specific version of the `vc-previous-revision'."
- (if file
- (with-temp-buffer
- (let* ((found (not rev))
- (oldver nil)
- line version)
- (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))
- (forward-line))
- oldver))))
+ (when file
+ (with-temp-buffer
+ (let* ((found (not rev))
+ (oldver nil)
+ line version)
+ (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))
+ (forward-line))
+ oldver))))
(defun vc-fossil-delete-file (file)
- [nongnu] elpa/vc-fossil ac82044 065/111: Do not raise errors in next-revision and previous-revision commands., (continued)
- [nongnu] elpa/vc-fossil ac82044 065/111: Do not raise errors in next-revision and previous-revision commands., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 007187d 075/111: Merge changes from pdo for emacs 25 support, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 67855dd 081/111: Fixed accidental breakage in last commit., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil e0d3521 085/111: Enforced double-dash internal function convention., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 1bef549 109/111: From Upstream: ams: Add (vc-fossil-link), ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 6beb2f2 092/111: Merge old trunk I hope, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 4e95c73 094/111: Merged., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 2fd4bf0 095/111: Improved vc-dir performance on large repositories., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil aff450c 018/111: deal with some compiler warnings (assignments to line etc remain), ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 0921094 023/111: whitespace and fiddle with a instructions comment, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil eeb48f4 024/111: fiddle with some if constructs so I can read this,
ELPA Syncer <=
- [nongnu] elpa/vc-fossil 5e71178 029/111: ideomatic lisp, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil adb17bc 034/111: Use file-truename in vc-fossil-state otherwise status is not returned if called from outside a fossil tree, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 13a0a69 036/111: Untabify, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 1319569 041/111: Show unregistered files in dir stat., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f0f81f8 043/111: Fix `vc-fossil-find-revision`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 49552ae 046/111: Delete and rename modify working directory., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 798b503 054/111: Fix file name expansion in log command., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 9f31709 055/111: Fix diff command if old rev is not specified., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 0ab9dce 057/111: Implement diff for the root directory., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 141937e 062/111: Fix checkout command for special revisions., ELPA Syncer, 2021/09/29