GNU bug report logs - #5345
Password asked when visiting a file in a lightweight checkout

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Sat, 9 Jan 2010 02:43:01 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 5345 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: 5345 <at> debbugs.gnu.org
Subject: Re: bug#5345: Password asked when visiting a file in a lightweight 
	checkout
Date: Sat, 9 Jan 2010 21:08:58 +0100
On Sat, Jan 9, 2010 at 20:20, Dan Nicolaescu <dann <at> ics.uci.edu> wrote:

> Is that the correct URL syntax?

Yes. This kind of URL is very common when dealing with files on
Windows. According to RFC 1738 ("Uniform Resource Locators (URL)"),
section 3.10 ("FILES"), the syntax is

     file://<host>/<path>

i.e., the slashes are separators. And "[a]s a special case, <host> can
be the string "localhost" or the empty string; this is interpreted as
`the machine from which the URL is being interpreted'.". So
file:///C:/path is a perfectly valid URL for a local file on Windows,
as a shorthand for file://localhost/C:/path. I'm surprised Unix URLs
for absolute paths do not start with file:////.

> But please do it with a system-type test, /C:/emacs/repo/bugs/5313/ is a
> valid unix file name.  Probably not used too much, but valid, so it
> should not be excluded.

Are you OK with the following patch?

    Juanma


=== modified file 'lisp/vc-bzr.el'
--- lisp/vc-bzr.el	2010-01-06 15:11:52 +0000
+++ lisp/vc-bzr.el	2010-01-09 20:06:10 +0000
@@ -361,6 +361,11 @@
 		     ;; look there for the version information.
 		     (when (re-search-forward "file://\\(.+\\)" nil t)
 		       (let ((l-c-parent-dir (match-string 1)))
+			 (when (and (memq system-type '(ms-dos windows-nt))
+				    (string-match-p "^/[[:alpha:]]:" l-c-parent-dir))
+			   ;;; On Windows, file:// URLs often have three slashes,
+			   ;;; so we must remove the remaining one (bug#5345)
+			   (setq l-c-parent-dir (substring l-c-parent-dir 1)))
 			 (setq branch-format-file
 			       (expand-file-name vc-bzr-admin-branch-format-file
 						 l-c-parent-dir))




This bug report was last modified 15 years and 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.