all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for assertions in vc-hg.el
@ 2017-09-19 16:44 Andy Moreton
  2017-09-30 13:22 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Moreton @ 2017-09-19 16:44 UTC (permalink / raw)
  To: emacs-devel


For emacs on Windows, the cl-assert calls in vc-hg.el grumble due to file names
being in Windows format, and so failing to match the regexp.

The following fixes this for me (applies cleanly to emacs-26):

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 5fb93bc..5d058bb 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -685,7 +685,8 @@ vc-hg--pcre-to-elisp-re
 patterns are rooted.  We understand only a subset of PCRE syntax;
 if we don't understand a construct, we signal
 `vc-hg-unsupported-syntax'."
-  (cl-assert (string-match "^/\\(.*/\\)?$" prefix))
+  (cl-assert (and (file-name-absolute-p prefix)
+                  (directory-name-p prefix)))
   (let ((parts nil)
         (i 0)
         (anchored nil)
@@ -873,7 +874,8 @@ vc-hg--slurp-hgignore-1
 (defun vc-hg--slurp-hgignore (repo)
   "Read hg ignore patterns from REPO.
 REPO must be the directory name of an hg repository."
-  (cl-assert (string-match "^/\\(.*/\\)?$" repo))
+  (cl-assert (and (file-name-absolute-p repo)
+                  (directory-name-p repo)))
   (let* ((hgignore (concat repo ".hgignore"))
          (vc-hg--hgignore-patterns nil)
          (vc-hg--hgignore-filenames nil))
@@ -928,7 +929,8 @@ vc-hg--file-ignored-p
      (concat repo repo-relative-filename))))
 
 (defun vc-hg--read-repo-requirements (repo)
-  (cl-assert (string-match "^/\\(.*/\\)?$" repo))
+  (cl-assert (and (file-name-absolute-p repo)
+                  (directory-name-p repo)))
   (let* ((requires-filename (concat repo ".hg/requires")))
     (and (file-exists-p requires-filename)
          (with-temp-buffer
@@ -1000,7 +1001,8 @@ vc-hg-state-fast
          ;; dirstate must exist
          (not (progn
                 (setf repo (expand-file-name repo))
-                (cl-assert (string-match "^/\\(.*/\\)?$" repo))
+                (cl-assert (and (file-name-absolute-p repo)
+                                (directory-name-p repo)))
                 (setf dirstate (concat repo ".hg/dirstate"))
                 (setf dirstate-attr (file-attributes dirstate))))
          ;; Repository must be in an understood format




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Patch for assertions in vc-hg.el
  2017-09-19 16:44 Patch for assertions in vc-hg.el Andy Moreton
@ 2017-09-30 13:22 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2017-09-30 13:22 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

> From: Andy Moreton <andrewjmoreton@gmail.com>
> Date: Tue, 19 Sep 2017 17:44:53 +0100
> 
> 
> For emacs on Windows, the cl-assert calls in vc-hg.el grumble due to file names
> being in Windows format, and so failing to match the regexp.
> 
> The following fixes this for me (applies cleanly to emacs-26):

Thanks, pushed to the release branch.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-30 13:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 16:44 Patch for assertions in vc-hg.el Andy Moreton
2017-09-30 13:22 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.