Display all remotes in vc-dir

sellout
Oct 13, 2022, 5:14 AM
U4ORTSFJV24RHAT6FQ6OVLZXXN3W2CPG7KG4RSNG7U3N6DTAAJEQC

Dependencies

Change contents

  • replacement in vc-pijul.el at line 294
    [3.11356][3.5820:5853](),[3.5853][3.11389:11437](),[3.11389][3.11389:11437]()
    (defun vc-pijul-get-remote (dir)
    "Get the remote repository location, if any."
    [3.11356]
    [3.5854]
    ;; Currently, there is not an easy way to tell the default remote from the other
    ;; remotes (other than parsing the config file), the oldest one the default, and;; order the list chronologically.
    (defun vc-pijul-get-remotes (dir)
    "Get the remote repository locations, if any. The default remote will
    _probably_ be the first in the list."
  • replacement in vc-pijul.el at line 304
    [3.6041][3.6041:6103]()
    (buffer-substring-no-properties (point) (point-max)))))
    [3.6041]
    [3.11819]
    (kill-rectangle (point-min) (point))
    (nreverse
    (split-string
    (buffer-substring-no-properties (point-min) (1- (point-max)))
    "\n")))))
  • replacement in vc-pijul.el at line 310
    [3.11820][3.6104:6137](),[3.6137][3.11853:11984](),[3.11853][3.11853:11984]()
    (defun vc-pijul-dir-header (k v)
    (list
    (concat
    (propertize k 'face 'font-lock-type-face)
    " "
    (propertize v 'face 'font-lock-variable-name-face))))
    [3.11820]
    [3.11984]
    (defun vc-pijul--dir-header (width k v)
    "Creates a string, stylized as a vc-dir header from a K (a string) and V
    (either a string or a list of strings). K will be truncated if it is longer than
    the provided width."
    (concat
    (propertize (concat (truncate-string-to-width k width nil ?\s t t) ": ")
    'face
    'vc-dir-header)
    (propertize (cond ((listp v)
    (mapconcat 'identity
    v
    (concat "\n" (make-string (+ 2 width) ?\s))))
    (t
    v))
    'face
    'vc-dir-header-value)))
  • replacement in vc-pijul.el at line 328
    [3.6178][3.12025:12062](),[3.12025][3.12025:12062](),[3.12062][3.6179:6217](),[3.6217][2.1:72](),[2.72][3.6218:6384](),[3.12139][3.6218:6384](),[3.6384][3.12298:12308](),[3.12298][3.12298:12308]()
    (mapconcat
    #'identity
    (nconc
    (let ((root (vc-pijul-root dir)))
    (and root (not (equal (file-truename dir) (file-truename root)))
    (vc-pijul-dir-header "Repository :" root)))
    (let ((remote (vc-pijul-get-remote dir)))
    (and remote (vc-pijul-dir-header "Remote :" remote))))
    "\n"))
    [3.6178]
    [3.12308]
    (let ((width 11)) ; the width of a header key in vc-dir
    (mapconcat
    'identity
    (nconc
    (let ((root (vc-pijul-root dir)))
    (and root (not (equal (file-truename dir) (file-truename root)))
    (list (vc-pijul--dir-header width "Repository" root))))
    (let ((remotes (vc-pijul-get-remotes dir)))
    (and remotes (list (vc-pijul--dir-header width "Remotes" remotes)))))
    "\n")))