[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vc-fossil f68c80a 077/111: Merged enhanced vc-dir buffer h
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vc-fossil f68c80a 077/111: Merged enhanced vc-dir buffer header capability. |
Date: |
Wed, 29 Sep 2021 08:59:24 -0400 (EDT) |
branch: elpa/vc-fossil
commit f68c80a4a01c5b17f8f830f7481296214b9f9e11
Merge: 007187d 5089a96
Author: pdo <pdo>
Commit: pdo <pdo>
Merged enhanced vc-dir buffer header capability.
---
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 c1585fc 040/111: Remove `vc-fossil-after-dir-status`., (continued)
- [nongnu] elpa/vc-fossil c1585fc 040/111: Remove `vc-fossil-after-dir-status`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 54df12a 045/111: Fix parameter passing in `vc-fossil-find-revision`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 3c8fae8 016/111: Mulitple changes to allow 23.2 integration and to fix fossil-state-code incorrectly still using --file to update -n -v, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 9856860 021/111: appropriate autoload, and consistent "add fossil" expression in docs, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 1d46c62 027/111: eschew some redundancy, and use modern apply syntax, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 0497f8f 037/111: Remove some old debug messages., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f69eac0 047/111: Add end-of-file comment., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 3455e4a 049/111: Access command switches by `vc-switches`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 4ce0039 052/111: Enable word-wrap with indentation in log view., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 03282dc 063/111: Implement next-revision command for whole repository., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f68c80a 077/111: Merged enhanced vc-dir buffer header capability.,
ELPA Syncer <=
- [nongnu] elpa/vc-fossil 6174102 078/111: Create README.md, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil b43a7e2 073/111: Added Emacs 25 compatibility., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 0aceef3 071/111: Add GPLv3 as the default license, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 6029bc2 082/111: Updates from pdo, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 4724850 089/111: Merged vc-push functionality and some code cleanups., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 8e34d7b 080/111: Added support for vc-push command., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 7f26034 087/111: Corrected vc-fossil-dir-status function., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 2747e6c 103/111: Move vc-fossil.el to top dir, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 4d3e1cb 086/111: Update vc-dir header info after fossil commands., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil ec551ba 056/111: Implement previous-revision command for whole repository., ELPA Syncer, 2021/09/29