vc-hg-known-other-working-trees: Fix on MS-Windows

* lisp/vc/vc-hg.el (vc-hg-known-other-working-trees): Use
expand-file-name to convert paths from .hg/sharedpath files.
This commit is contained in:
Eli Zaretskii 2025-08-16 19:40:11 +01:00 committed by Sean Whitton
parent 85dcf4fe96
commit f8cb751ac0

View file

@ -1738,7 +1738,10 @@ Intended for use via the `vc-hg--async-command' wrapper."
(if (file-exists-p our-sp)
(with-temp-buffer
(insert-file-contents-literally our-sp)
(setq our-store (string-trim (buffer-string)))
;; On MS-Windows, ".hg/sharedpath" gives file names with
;; backslashes; expand-file-name normalizes that to forward
;; slashes, needed for 'equal' comparison below.
(setq our-store (expand-file-name (string-trim (buffer-string))))
(push (abbreviate-file-name (file-name-directory our-store))
shares))
(setq our-store (expand-file-name ".hg" our-root)))
@ -1748,7 +1751,9 @@ Intended for use via the `vc-hg--async-command' wrapper."
((file-exists-p sp)))
(with-temp-buffer
(insert-file-contents-literally sp)
(when (equal our-store (buffer-string))
(when (equal our-store
;; See above why we use expand-file-name
(expand-file-name (string-trim (buffer-string))))
(push root shares)))))
shares))