Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Mercurial's ssh:// URL use two slashes before the path?

Tags:

url

mercurial

Example Mercurial URL: ssh://myhost//path/to/repo

Why two slashes? The hostname is already specified. Why it does not work like http://myhost/path/to/page where only one slash is sufficient?

like image 795
Stride Avatar asked Oct 18 '10 18:10

Stride


2 Answers

See this url, which says this:

path is relative to the remote user's home directory by default. Use an extra slash at the start of a path to specify an absolute path:

like image 100
Thanatos Avatar answered Jan 02 '23 05:01

Thanatos


Usually a URL is formed in the following way: scheme://user@host:port/path, with the user@ and :port part being optional. This means the first / is the separator between the host part and the path part: it is not part of the path.

Then the path can either be absolute (starts with a /) or relative to the home directory of the user (no /).

This is just a reminder that the paths used by rsync or scp are not urls.

like image 36
tonfa Avatar answered Jan 02 '23 03:01

tonfa