From a9383c13c5fa7abd3b83a89ed7a597ba019a9e08 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 26 Aug 2011 16:23:35 +0200 Subject: [PATCH 1/2] subrepo: fix cloning of repos from urls without slash after host (issue2970) This fixes a regression introduced with the new url handling in 1.9. This should perhaps be fixed in the url class instead, but that might be too invasive for a stable bugfix. --- mercurial/subrepo.py | 2 +- tests/test-http.t | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py index ca59f1126a..b5068d0ad1 100644 --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -204,7 +204,7 @@ def _abssource(repo, push=False, abort=True): parent = _abssource(repo._subparent, push, abort=False) if parent: parent = util.url(parent) - parent.path = posixpath.join(parent.path, source.path) + parent.path = posixpath.join(parent.path or '', source.path) parent.path = posixpath.normpath(parent.path) return str(parent) else: # recursion reached top repo diff --git a/tests/test-http.t b/tests/test-http.t index 0956da7673..eb9b7dff1a 100644 --- a/tests/test-http.t +++ b/tests/test-http.t @@ -159,6 +159,32 @@ test http authentication $ cd .. +clone of serve with repo in root and unserved subrepo (issue2970) + + $ hg --cwd test init sub + $ hg --cwd test/sub tag something + $ echo sub = sub > test/.hgsub + $ hg --cwd test add .hgsub + $ hg --cwd test commit -qm 'add subrepo' + $ hg clone http://localhost:$HGPORT noslash-clone + requesting all changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 7 changes to 7 files + updating to branch default + abort: HTTP Error 404: Not Found + [255] + $ hg clone http://localhost:$HGPORT/ slash-clone + requesting all changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 7 changes to 7 files + updating to branch default + abort: HTTP Error 404: Not Found + [255] + check error log $ cat error.log From 9fe3bba5d09eed879f5b71ce071a9c4b4eca5d7d Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Fri, 26 Aug 2011 16:07:16 -0500 Subject: [PATCH 2/2] Added signature for changeset 9377ee819950 --- .hgsigs | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgsigs b/.hgsigs index bc4c88edb4..d1aec95f15 100644 --- a/.hgsigs +++ b/.hgsigs @@ -41,3 +41,4 @@ b032bec2c0a651ca0ddecb65714bfe6770f67d70 0 iD8DBQBNlg5kywK+sNU5EO8RAnGEAJ9gmEx6M 733af5d9f6b22387913e1d11350fb8cb7c1487dd 0 iD8DBQBN5q/8ywK+sNU5EO8RArRGAKCNGT94GKIYtSuwZ57z1sQbcw6uLACfffpbMV4NAPMl8womAwg+7ZPKnIU= de9eb6b1da4fc522b1cab16d86ca166204c24f25 0 iD8DBQBODhfhywK+sNU5EO8RAr2+AJ4ugbAj8ae8/K0bYZzx3sascIAg1QCeK3b+zbbVVqd3b7CDpwFnaX8kTd4= 4a43e23b8c55b4566b8200bf69fe2158485a2634 0 iD8DBQBONzIMywK+sNU5EO8RAj5SAJ0aPS3+JHnyI6bHB2Fl0LImbDmagwCdGbDLp1S7TFobxXudOH49bX45Iik= +d629f1e89021103f1753addcef6b310e4435b184 0 iD8DBQBOWAsBywK+sNU5EO8RAht4AJwJl9oNFopuGkj5m8aKuf7bqPkoAQCeNrEm7UhFsZKYT5iUOjnMV7s2LaM=