[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vc-fossil 5089a96 076/111: Enhanced vc-fossil-dir-extra-he
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vc-fossil 5089a96 076/111: Enhanced vc-fossil-dir-extra-headers function. |
Date: |
Wed, 29 Sep 2021 08:59:24 -0400 (EDT) |
branch: elpa/vc-fossil
commit 5089a965e03e7cae11aba9b8a9d13b4564ec1d02
Author: pdo <pdo>
Commit: pdo <pdo>
Enhanced vc-fossil-dir-extra-headers function.
---
vc/el/vc-fossil.el | 71 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 52 insertions(+), 19 deletions(-)
diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el
index 1941a0e..9ff9442 100644
--- a/vc/el/vc-fossil.el
+++ b/vc/el/vc-fossil.el
@@ -74,6 +74,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no
switches."
(repeat :tag "Argument List" :value ("") string))
:group 'vc-fossil)
+(defcustom vc-fossil-extra-header-fields (list :checkout :tags)
+ "A list of keywords denoting extra header fields to show in the vc-dir
buffer."
+ :type '(set (const :repository) (const :remote-url) (const :synchro)
+ (const :checkout) (const :comment) (const :tags))
+ :group 'vc-fossil)
+
;;; BACKEND PROPERTIES
@@ -165,8 +171,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no
switches."
(eq 'up-to-date (vc-fossil-state file)))
;; TODO: mode-line-string
-;; TODO: dir-printer / dir-extra-headers
-
+;; TODO: dir-printer
(defun vc-fossil-dir-status (dir update-function)
"Get fossil status for all files in a directory"
@@ -212,25 +217,53 @@ If `files` is nil return the status for all files."
(defun vc-fossil-dir-status-files (dir files update-function)
(vc-fossil-dir-status-files-i dir files update-function))
(defun vc-fossil-dir-status-files (dir files default-state update-function)
- (vc-fossil-dir-status-files-i dir files update-function)))
-
-(defun vc-fossil-checkout-model (files) 'implicit)
+ (vc-fossil-dir-status-files-i dir files update-function)))
(defun vc-fossil-dir-extra-headers (dir)
- (let* ((info (vc-fossil--run "info"))
- (posco (string-match "checkout: *\\([0-9a-fA-F]+\\) \\([-0-9: ]+
UTC\\)" info))
- (coid (substring (match-string 1 info) 0 9))
- (cots (format-time-string "%Y-%m-%d %H:%M:%S %Z"
- (safe-date-to-time (match-string 2 info))))
- (postag (string-match "tags: *\\(.*\\)" info))
- (tags (match-string 1 info))
- )
- (concat
- (propertize "Checkout : " 'face 'font-lock-type-face)
- (propertize (concat coid " " cots) 'face 'font-lock-variable-name-face)
- "\n"
- (propertize "Tags : " 'face 'font-lock-type-face)
- (propertize tags 'face 'font-lock-variable-name-face))))
+ (let ((info (vc-fossil--run "info"))
+ (settings (vc-fossil--run "settings"))
+ (lines nil))
+ (dolist (field vc-fossil-extra-header-fields)
+ (unless (null lines)
+ (push "\n" lines))
+ (cond ((eql field :repository)
+ (string-match "repository: *\\(.*\\)$" info)
+ (let ((repo (match-string 1 info)))
+ (push (propertize "Repository : " 'face 'font-lock-type-face)
lines)
+ (push (propertize repo 'face 'font-lock-variable-name-face)
lines)))
+ ((eql field :remote-url)
+ (let ((remote-url (car (split-string (vc-fossil--run
"remote-url")))))
+ (push (propertize "Remote URL : " 'face 'font-lock-type-face)
lines)
+ (push (propertize remote-url 'face
'font-lock-variable-name-face) lines)))
+ ((eql field :synchro)
+ (let* ((as-match (string-match "^autosync.+\\([[:digit:]]\\)$"
settings))
+ (autosync (if as-match (match-string 1 settings) "0"))
+ (dp-match (string-match "^dont-push.+\\([[:digit:]]\\)$"
settings))
+ (dontpush (if dp-match (match-string 1 settings) "0")))
+ (push (propertize "Synchro : " 'face 'font-lock-type-face)
lines)
+ (push (propertize (concat "autosync=" autosync) 'face
'font-lock-variable-name-face) lines)
+ (push (propertize (concat " dont-push=" dontpush) 'face
'font-lock-variable-name-face) lines)))
+ ((eql field :checkout)
+ (let* ((posco (string-match "checkout: *\\([0-9a-fA-F]+\\)
\\([-0-9: ]+ UTC\\)" info))
+ (coid (substring (match-string 1 info) 0 10))
+ (cots (format-time-string "%Y-%m-%d %H:%M:%S %Z"
+ (safe-date-to-time (match-string
2 info))))
+ (child-match (string-match "child: *\\(.*\\)$" info))
+ (leaf (if child-match "NON-LEAF" "leaf")))
+ (push (propertize "Checkout : " 'face 'font-lock-type-face)
lines)
+ (push (propertize (concat coid " " cots) 'face
'font-lock-variable-name-face) lines)
+ (push (propertize (concat " (" leaf ")") 'face
'font-lock-variable-name-face) lines)))
+ ((eql field :comment)
+ (string-match "comment: *\\(.*\\)$" info)
+ (let ((msg (match-string 1 info)))
+ (push (propertize "Comment : " 'face 'font-lock-type-face)
lines)
+ (push (propertize msg 'face 'font-lock-variable-name-face)
lines)))
+ ((eql field :tags)
+ (string-match "tags: *\\(.*\\)" info)
+ (let ((tags (match-string 1 info)))
+ (push (propertize "Tags : " 'face 'font-lock-type-face)
lines)
+ (push (propertize tags 'face 'font-lock-variable-name-face)
lines)))))
+ (apply #'concat (nreverse lines))))
;;; STATE-CHANGING FUNCTIONS
- [nongnu] elpa/vc-fossil 93c2104 101/111: Merge pull request #1 from barak/trunk, (continued)
- [nongnu] elpa/vc-fossil 93c2104 101/111: Merge pull request #1 from barak/trunk, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil bf1969f 033/111: Undo file-truename in log because emacs-23.3.1 gives relative names which confuse fossil., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil c058f3d 039/111: Remove debug message from `vc-fossil-after-dir-status`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f4795ba 044/111: Pass `vc-checkout-switches` on checkout., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 6619ffb 048/111: Improve log command., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil b632993 050/111: Handle switches in diff command., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 560d708 051/111: Implement annotate commanad., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 169cff6 053/111: Suppress echo message when enabling word wrap in log view., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil e2ec578 060/111: Use `vc-fossil-command` if the output is inserted in a buffer., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 5b0c159 067/111: Updates from Frank Fisher. colorized logs, vc-annotate, fixes for the diff command, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 5089a96 076/111: Enhanced vc-fossil-dir-extra-headers function.,
ELPA Syncer <=
- [nongnu] elpa/vc-fossil 34b0ed9 096/111: Merged., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil d03f490 090/111: Added package installation instructions., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 00ff203 031/111: Allow .fslckout in Unix as fossil db name. (for [769989987d]), ELPA Syncer, 2021/09/29